summaryrefslogtreecommitdiffstats
path: root/servers/rendering/renderer_rd
diff options
context:
space:
mode:
authorm-pranav-r <darthsreepa@protonmail.com>2024-10-16 14:55:41 +0530
committerm-pranav-r <darthsreepa@protonmail.com>2024-10-16 14:55:41 +0530
commitc12001a9dc4c9d035d92b173ade61596ce47b068 (patch)
tree1624bdc9f1a99a34f6cd654f84a7bd9f7c3d15ae /servers/rendering/renderer_rd
parentaf77100e394dcaca609b15bef815ed17475e51ed (diff)
downloadredot-engine-c12001a9dc4c9d035d92b173ade61596ce47b068.tar.gz
Fix incorrect depth comparison used to calculate volumetric fog shadowing
Diffstat (limited to 'servers/rendering/renderer_rd')
-rw-r--r--servers/rendering/renderer_rd/shaders/environment/volumetric_fog_process.glsl1
1 files changed, 1 insertions, 0 deletions
diff --git a/servers/rendering/renderer_rd/shaders/environment/volumetric_fog_process.glsl b/servers/rendering/renderer_rd/shaders/environment/volumetric_fog_process.glsl
index a797891ab6..90bbdfe685 100644
--- a/servers/rendering/renderer_rd/shaders/environment/volumetric_fog_process.glsl
+++ b/servers/rendering/renderer_rd/shaders/environment/volumetric_fog_process.glsl
@@ -513,6 +513,7 @@ void main() {
shadow_sample.z = 1.0 + abs(shadow_sample.z);
vec3 pos = vec3(shadow_sample.xy / shadow_sample.z, shadow_len - omni_lights.data[light_index].shadow_bias);
pos.z *= omni_lights.data[light_index].inv_radius;
+ pos.z = 1.0 - pos.z;
pos.xy = pos.xy * 0.5 + 0.5;
pos.xy = uv_rect.xy + pos.xy * uv_rect.zw;