Fix spotlight's shadow with volumetric fog

This commit is contained in:
Florent Guiocheau 2025-08-13 09:28:06 +02:00
parent 8aa37cab89
commit 199161f023

View file

@ -559,7 +559,7 @@ void main() {
vec4 v = vec4(view_pos, 1.0);
vec4 splane = (spot_lights.data[light_index].shadow_matrix * v);
splane.z -= spot_lights.data[light_index].shadow_bias / (d * spot_lights.data[light_index].inv_radius);
splane.z -= spot_lights.data[light_index].shadow_bias;
splane /= splane.w;
vec3 pos = vec3(splane.xy * spot_lights.data[light_index].atlas_rect.zw + spot_lights.data[light_index].atlas_rect.xy, splane.z);