浏览代码

Minor change on shadows

ShiroSmith 5 年之前
父节点
当前提交
79a7793a56
共有 2 个文件被更改,包括 4 次插入4 次删除
  1. 2 2
      h3d/pass/PointShadowMap.hx
  2. 2 2
      h3d/pass/SpotShadowMap.hx

+ 2 - 2
h3d/pass/PointShadowMap.hx

@@ -195,9 +195,9 @@ class PointShadowMap extends Shadows {
 		}
 
 		var texture = ctx.computingStatic ? createStaticTexture() : ctx.textures.allocTarget("pointShadowMap", size, size, false, format, true);
-		if( depth == null || depth.width != size || depth.height != size || depth.isDisposed() ) {
+		if( depth == null || depth.width != texture.width || depth.height != texture.height || depth.isDisposed() ) {
 			if( depth != null ) depth.dispose();
-			depth = new h3d.mat.DepthBuffer(size, size);
+			depth = new h3d.mat.DepthBuffer(texture.width, texture.height);
 		}
 		texture.depthBuffer = depth;
 

+ 2 - 2
h3d/pass/SpotShadowMap.hx

@@ -133,9 +133,9 @@ class SpotShadowMap extends Shadows {
 		cullPasses(passes, function(col) return col.inFrustum(lightCamera.frustum));
 
 		var texture = ctx.computingStatic ? createStaticTexture() : ctx.textures.allocTarget("spotShadowMap", size, size, false, format);
-		if( customDepth && (depth == null || depth.width != size || depth.height != size || depth.isDisposed()) ) {
+		if( customDepth && (depth == null || depth.width != texture.width || depth.height != texture.height || depth.isDisposed()) ) {
 			if( depth != null ) depth.dispose();
-			depth = new h3d.mat.DepthBuffer(size, size);
+			depth = new h3d.mat.DepthBuffer(texture.width, texture.height);
 		}
 		texture.depthBuffer = depth;