Skip to content

Commit 44a639f

Browse files
committed
Restore old fog blending behavior in the Forward+ scene shader
1 parent cb3af5a commit 44a639f

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

servers/rendering/renderer_rd/shaders/forward_clustered/scene_forward_clustered.glsl

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1449,13 +1449,10 @@ void fragment_shader(in SceneData scene_data) {
14491449
float sa = 1.0 - volumetric_fog.a;
14501450
res.a = fog.a * sa + volumetric_fog.a;
14511451
if (res.a > 0.0) {
1452-
res.rgb = (fog.rgb * fog.a * sa + volumetric_fog.rgb) / res.a;
1452+
res.rgb = (fog.rgb * fog.a * sa + volumetric_fog.rgb * volumetric_fog.a) / res.a;
14531453
}
14541454
} else {
1455-
res.a = volumetric_fog.a;
1456-
if (res.a > 0.0) {
1457-
res.rgb = volumetric_fog.rgb / res.a;
1458-
}
1455+
res = volumetric_fog;
14591456
}
14601457
fog = res;
14611458
}

0 commit comments

Comments
 (0)