浏览代码

fixed shadow bounds calculus should be done before culling

Nicolas Cannasse 4 年之前
父节点
当前提交
b955a000da
共有 1 个文件被更改,包括 6 次插入5 次删除
  1. 6 5
      h3d/pass/DirShadowMap.hx

+ 6 - 5
h3d/pass/DirShadowMap.hx

@@ -188,11 +188,6 @@ class DirShadowMap extends Shadows {
 
 	override function setGlobals() {
 		super.setGlobals();
-		if( mode != Mixed || ctx.computingStatic ) {
-			lightCamera.orthoBounds.empty();
-			calcShadowBounds(lightCamera);
-			lightCamera.update();
-		}
 		cameraViewProj = getShadowProj();
 	}
 
@@ -277,6 +272,12 @@ class DirShadowMap extends Shadows {
 		if( !filterPasses(passes) )
 			return;
 
+		if( mode != Mixed || ctx.computingStatic ) {
+			lightCamera.orthoBounds.empty();
+			calcShadowBounds(lightCamera);
+			lightCamera.update();
+		}
+
 		cullPasses(passes,function(col) return col.inFrustum(lightCamera.frustum));
 
 		var texture = ctx.textures.allocTarget("dirShadowMap", size, size, false, format);