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

Separate sky luminance and brightness calculations for consistent fog #100427

Merged
merged 1 commit into from
Dec 20, 2024

Conversation

Namey5
Copy link
Contributor

@Namey5 Namey5 commented Dec 15, 2024

Luminance + user-controlled brightness multipliers were combined into a single push-constant for application in the Sky shader - this had the side effect of accumulated fog also being controlled by the environment brightness value (and not just renderer luminance).

Before (Forward+, volumetric fog):
volumetric before

After (Forward+, volumetric fog):
volumetric after

After (Forward+, distance fog):
forward+ after

After (Mobile, distance fog - just to show luminance still working):
mobile after

This is my first time delving into actual render code in Godot, so I have implemented this recommendation in the simplest way possible - by keeping configuration the same and literally just splitting the two multipliers into separate push constants.

Fixes #98640

@Namey5 Namey5 requested a review from a team as a code owner December 15, 2024 11:21
@Chaosus Chaosus added this to the 4.4 milestone Dec 16, 2024
Copy link
Member

@clayjohn clayjohn left a comment

Choose a reason for hiding this comment

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

Looks great. This matches how it works in the Compatibility renderer, so now everything is consistent too, which is nice.

@Repiteo Repiteo merged commit 4665faa into godotengine:master Dec 20, 2024
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Dec 20, 2024

Thanks!

@Namey5 Namey5 deleted the fog-sky-luminance branch December 20, 2024 02:32
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.

Volumetric fog doesn't affect sky when sky is set to low luminance
5 participants