Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix walls being too bright in OpenGL #590

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jackrjli
Copy link
Contributor

This reverts some of the changes that were made to the indexed lightmode shader when it was refactored for smooth fade mode (#409). In my testing these end up making the indexed lightmode less accurate to software.

Note that this does not address floors and ceilings being different between software and OpenGL, but walls should be pretty close.

Comparison screenshots:
Software
sw

OpenGL, without this change
gl-before

OpenGL, with this change
gl-after

- Divide by 32 instead of 33
- Remove rounding of light level and light index
- Revert color index calculation (I don't see any difference myself, but maybe there's a reason for it)
@Kappa971
Copy link

If you look at this #588, you'll notice that I'm getting a different result than shown here.
My screenshots are in 1920x1080, maybe the lighting changes based on the resolution?

@jackrjli
Copy link
Contributor Author

@Kappa971 Are you autoloading the WAD shared in Discord? That's an older version of what I have here.

@Kappa971
Copy link

@Kappa971 Are you autoloading the WAD shared in Discord? That's an older version of what I have here.

I'm not autoloading any WADs, except widescreen STBAR.

@jackrjli
Copy link
Contributor Author

This is what I get at 1920x1080 resolution:

Software
sw

OpenGL (no fix)
gl-old

OpenGL (with fix)
gl-new

Could you test this WAD (or build dsda-doom.wad with this change) to see how it looks?
gllightfix_new.zip

@Kappa971
Copy link

As you can see by comparing your OpenGL (no fix) image with the one in the issue I opened, they are equally different (as before), so I think the resolution has nothing to do with it.
I am using DSDA-Doom compiled on January 27th and not version 0.28.3. I'm on Windows 11 and I'm using an AMD GPU.

With "gllightfix_new.wad" the result seems the same instead:
dsda-doom fix
but still different from software rendering, so it's not really a fix but just a slight improvement. Someone with OpenGL knowledge would be needed to dig into this (In my opinion).

@Pedro-Beirao
Copy link
Collaborator

@Kappa971 so your concern is that it isnt a 1:1 match with software? Well it never will be. OpenGL is just a completely different way to render.
But this is a good change that shortens the difference.

@Kappa971
Copy link

Just to know, why are @jackrjli and I experiencing different behavior?
@jackrjli OpenGL (no fix)
image

@Kappa971 OpenGL (no fix)
image

@Pedro-Beirao
Copy link
Collaborator

I dont know how to answer that. The no-fix behaviour is also different for me, but the fixed one is the same as the screenshots you guys sent.
Maybe in the old code there was something that was calculated differently in each GPU?

Interestingly, the no-fix looks very similar, just slightly different, to the new one in my machine (M1 Mac).

OpenGL (no-fix)
1-old-gl

OpenGL (fix)

2-new-gl

Copy link
Collaborator

@Pedro-Beirao Pedro-Beirao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems right, and definitely gives better results

@jackrjli
Copy link
Contributor Author

No idea why we all get different "no fix" results, but at least the "with fix" results are the same 😅
For the record, I'm on Linux (Fedora 41), with an Nvidia GPU.
Just to throw one more into the mix, I gave it a try on my laptop with Intel integrated graphics:

OpenGL (no fix)
gl-before

OpenGL (with fix)
gl-after

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants