Merge pull request #82974 from mrjustaguy/Split-fix

Directional 2 Split Shadow Stabilization Fix
This commit is contained in:
Rémi Verschelde 2023-10-25 10:28:21 +02:00
commit 9798ae3d6a
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -2239,7 +2239,7 @@ void RendererSceneCull::_light_instance_setup_directional_shadow(int p_shadow_in
// This trick here is what stabilizes the shadow (make potential jaggies to not move)
// at the cost of some wasted resolution. Still, the quality increase is very well worth it.
const real_t unit = (radius + soft_shadow_expand) * 2.0 / texture_size;
const real_t unit = (radius + soft_shadow_expand) * 4.0 / texture_size;
x_max_cam = Math::snapped(x_vec.dot(center) + radius + soft_shadow_expand, unit);
x_min_cam = Math::snapped(x_vec.dot(center) - radius - soft_shadow_expand, unit);
y_max_cam = Math::snapped(y_vec.dot(center) + radius + soft_shadow_expand, unit);