Unverified Commit 34ddb7ac by Rémi Verschelde Committed by GitHub

Merge pull request #34519 from MadEqua/fix-contact-shadows

Fix contact shadow when light is outside of viewport.
parents 58c07f27 d7f9d71b
......@@ -897,6 +897,7 @@ float contact_shadow_compute(vec3 pos, vec3 dir, float max_distance) {
bias += incr * 2.0;
vec3 uv_depth = (source.xyz / source.w) * 0.5 + 0.5;
if (uv_depth.x > 0.0 && uv_depth.x < 1.0 && uv_depth.y > 0.0 && uv_depth.y < 1.0) {
float depth = texture(depth_buffer, uv_depth.xy).r;
if (depth < uv_depth.z) {
......@@ -909,6 +910,9 @@ float contact_shadow_compute(vec3 pos, vec3 dir, float max_distance) {
ratio += ratio_incr;
steps -= 1.0;
} else {
return 1.0;
}
}
return 1.0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment