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

Move sky luminance scaling to before fog is applied #75812

Merged
merged 1 commit into from
Apr 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions servers/rendering/renderer_rd/shaders/environment/sky.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,10 @@ void main() {
frag_color.rgb = color;
frag_color.a = alpha;

// For mobile renderer we're multiplying by 0.5 as we're using a UNORM buffer.
// For both mobile and clustered, we also bake in the exposure value for the environment and camera.
frag_color.rgb = frag_color.rgb * params.luminance_multiplier;

#if !defined(DISABLE_FOG) && !defined(USE_CUBEMAP_PASS)

// Draw "fixed" fog before volumetric fog to ensure volumetric fog can appear in front of the sky.
Expand All @@ -285,10 +289,6 @@ void main() {
frag_color.a = 0.0;
}

// For mobile renderer we're multiplying by 0.5 as we're using a UNORM buffer.
// For both mobile and clustered, we also bake in the exposure value for the environment and camera.
frag_color.rgb = frag_color.rgb * params.luminance_multiplier;

#ifdef USE_DEBANDING
frag_color.rgb += interleaved_gradient_noise(gl_FragCoord.xy);
#endif
Expand Down