1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-29 16:16:38 +00:00

Various fixes for transmittance effect

Use correct shadow sampling for omni and spot lights

Disable transmittance if shadows are disabled

Correct DirectionalLight transmittance bias to match shadow bias (its still pretty sensitive though)

(cherry picked from commit d61fae36f3)
This commit is contained in:
clayjohn
2024-06-21 18:15:14 -07:00
committed by Rémi Verschelde
parent 430a69baed
commit 1250b4568a
3 changed files with 37 additions and 29 deletions

View File

@@ -1984,7 +1984,7 @@ void fragment_shader(in SceneData scene_data) {
#ifdef LIGHT_TRANSMITTANCE_USED
float transmittance_z = transmittance_depth;
#ifndef SHADOWS_DISABLED
if (directional_lights.data[i].shadow_opacity > 0.001) {
float depth_z = -vertex.z;
@@ -2031,7 +2031,8 @@ void fragment_shader(in SceneData scene_data) {
transmittance_z = z - shadow_z;
}
}
#endif
#endif // !SHADOWS_DISABLED
#endif // LIGHT_TRANSMITTANCE_USED
float shadow = 1.0;
#ifndef SHADOWS_DISABLED