Browse Source

Fix pointshadowmap

ShiroSmith 6 năm trước cách đây
mục cha
commit
d92c34b43a
1 tập tin đã thay đổi với 5 bổ sung0 xóa
  1. 5 0
      h3d/pass/PointShadowMap.hx

+ 5 - 0
h3d/pass/PointShadowMap.hx

@@ -141,6 +141,11 @@ class PointShadowMap extends Shadows {
 
 			var pointLight = cast(light, h3d.scene.pbr.PointLight);
 
+			var absPos = light.getAbsPos();
+			lightCamera.setCubeMap(i, new h3d.Vector(absPos.tx, absPos.ty, absPos.tz));
+			lightCamera.zFar = pointLight.range;
+			lightCamera.update();
+
 			ctx.engine.pushTarget(texture, i);
 			ctx.engine.clear(0xFFFFFF, 1);
 			passes = super.draw(passes);