소스 검색

Directional 2 Split Shadow Stabilization Fix

mrjustaguy 1 년 전
부모
커밋
45948dc2c9
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      servers/rendering/renderer_scene_cull.cpp

+ 1 - 1
servers/rendering/renderer_scene_cull.cpp

@@ -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)
 			// 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.
 			// 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_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);
 			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);
 			y_max_cam = Math::snapped(y_vec.dot(center) + radius + soft_shadow_expand, unit);