ShiroSmith 7 роки тому
батько
коміт
3505d80963
1 змінених файлів з 4 додано та 3 видалено
  1. 4 3
      h3d/scene/pbr/PointLight.hx

+ 4 - 3
h3d/scene/pbr/PointLight.hx

@@ -31,15 +31,16 @@ class PointLight extends Light {
 	}
 
 	override function sync(ctx) {
+		super.sync(ctx);
 
 		if(ctx.computingStatic && (shadows.mode == Static ||  shadows.mode == Mixed)){
 			culled = false; // Always render for baking
 		}
 		else{
 			var sphereVolume = new h3d.col.Sphere();
-			sphereVolume.x = pbr.lightPos.x;
-			sphereVolume.y = pbr.lightPos.y;
-			sphereVolume.z = pbr.lightPos.z;
+			sphereVolume.x = absPos.tx;
+			sphereVolume.y = absPos.ty;
+			sphereVolume.z = absPos.tz;
 			sphereVolume.r = this.range;
 			culled = !ctx.camera.getFrustum().hasSphere(sphereVolume);
 		}