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 fog color inversion if density is set 0 #72329

Closed
Closed
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
6 changes: 3 additions & 3 deletions drivers/gles3/shaders/scene.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -1079,8 +1079,8 @@ void main() {
#endif // !DISABLE_FOG
#endif // !CUSTOM_FOG_USED

uint fog_rg = packHalf2x16(fog.rg);
uint fog_ba = packHalf2x16(fog.ba);
uint fog_rg = packUnorm2x16(fog.rg);
uint fog_ba = packUnorm2x16(fog.ba);

// Convert colors to linear
albedo = srgb_to_linear(albedo);
Expand Down Expand Up @@ -1294,7 +1294,7 @@ void main() {
frag_color.rgb += emission + ambient_light;
#endif
#endif //MODE_UNSHADED
fog = vec4(unpackHalf2x16(fog_rg), unpackHalf2x16(fog_ba));
fog = vec4(unpackUnorm2x16(fog_rg), unpackUnorm2x16(fog_ba));

#ifndef DISABLE_FOG
if (scene_data.fog_enabled) {
Expand Down