diff options
author | m-pranav-r <darthsreepa@protonmail.com> | 2024-10-16 14:55:41 +0530 |
---|---|---|
committer | m-pranav-r <darthsreepa@protonmail.com> | 2024-10-16 14:55:41 +0530 |
commit | c12001a9dc4c9d035d92b173ade61596ce47b068 (patch) | |
tree | 1624bdc9f1a99a34f6cd654f84a7bd9f7c3d15ae /servers/rendering/renderer_rd | |
parent | af77100e394dcaca609b15bef815ed17475e51ed (diff) | |
download | redot-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.glsl | 1 |
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; |