1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-14 13:41:12 +00:00

Fix several issues with directional shadows

- Internally disable blend splits in orthogonal directional shadow mode
- Fix soft shadows ignoring fade and blend_splits
- Fix soft shadow edge stability
This commit is contained in:
Brian Semrau
2021-10-12 19:16:23 -04:00
parent 004b44e915
commit 4fefd7cddd
5 changed files with 27 additions and 39 deletions

View File

@@ -2076,7 +2076,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 * 2.0 / texture_size;
const real_t unit = (radius + soft_shadow_expand) * 2.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);