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

renderer: fix legacy dynamic light intensity #1143

Merged
merged 1 commit into from
May 25, 2024

Conversation

illwieckz
Copy link
Member

@illwieckz illwieckz commented May 13, 2024

When I fixed the legacy dynamic light renderer in #1093, I noticed the dynamic light was too faint.

Since then I noticed the light was brighter with such renderer when legacy map overbright was enforced, meaning it was the overbright cancellation that was running where it should not.

This is now fixed.

Legacy dynamic light renderer with legacy overbright (reference):

unvanquished_2024-05-13_131200_000

Legacy dynamic light renderer with new overbright implementation:

unvanquished_2024-05-13_133738_000

For comparison, this is how it looks with the non-legacy tiled dynamic light renderer:

unvanquished_2024-05-13_131510_000

The light is believed to be different because the lighting algorithm is totally different to begin with.

The legacy light renderer not saturating to white is believed to be because the legacy dynamic light blends the dynamic light as a separate stage and the framebuffers are clamped to 1, meaning 1 * n where n is next stage color is always n. We can't fix that easily, it's a legacy renderer anyway.

@slipher
Copy link
Member

slipher commented May 25, 2024

LGTM (didn't really review or test)

@@ -1005,7 +1006,8 @@ void main()
color.rgb *= attenuationXY;
color.rgb *= attenuationZ;
#endif
color.rgb *= abs(u_LightScale);
color.rgb *= abs(u_LightScale)
color.rgb *= u_InverseLightFactor;
Copy link
Member Author

Choose a reason for hiding this comment

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

There was a missing ; there:

color.rgb *= abs(u_LightScale)
color.rgb *= u_InverseLightFactor;

Now fixed.

@illwieckz illwieckz force-pushed the illwieckz/legacy-light-intensity branch from 7191ee7 to 6e3f7b0 Compare May 25, 2024 11:18
@illwieckz illwieckz merged commit 7b5abf5 into master May 25, 2024
9 checks passed
@illwieckz illwieckz deleted the illwieckz/legacy-light-intensity branch May 25, 2024 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants