Fix: EEVEE: Point lights with zero radius create in shadow artifact

This is likely caused by local_ray_up being degenerate with
very small radii. This is a temporary fix and should be revisited
later.

The issue is that the real fix is likely to have a higher
performance cost.

Fix #124636
This commit is contained in:
Clément Foucault
2024-10-11 18:06:19 +02:00
parent 094f7235bb
commit 3764f53b1b

View File

@@ -238,6 +238,9 @@ ShadowRayPunctual shadow_ray_generate_punctual(LightData light, vec2 random_2d,
float clip_far = intBitsToFloat(light.clip_far);
float clip_near = intBitsToFloat(light.clip_near);
float shape_radius = light_spot_data_get(light).shadow_radius;
/* Clamp to a minimum value to avoid `local_ray_up` being degenerate. Could be revisited as the
* issue might reappear at different zoom level. */
shape_radius = max(0.00002, shape_radius);
vec3 direction;
if (is_area_light(light.type)) {