ShiroSmith 7 лет назад
Родитель
Сommit
15dace370e
2 измененных файлов с 1 добавлено и 15 удалено
  1. 1 1
      h3d/scene/LightSystem.hx
  2. 0 14
      h3d/scene/pbr/PointLight.hx

+ 1 - 1
h3d/scene/LightSystem.hx

@@ -46,7 +46,7 @@ class LightSystem {
 			s.z = l.absPos._43;
 			s.r = l.cullingDistance;
 
-			if( !frustum.hasSphere(s) ) {
+			if(!ctx.computingStatic && !frustum.hasSphere(s) ) {
 				if( prev == null )
 					ctx.lights = l.next;
 				else

+ 0 - 14
h3d/scene/pbr/PointLight.hx

@@ -33,20 +33,6 @@ 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 = absPos.tx;
-			sphereVolume.y = absPos.ty;
-			sphereVolume.z = absPos.tz;
-			sphereVolume.r = this.range;
-			culled = !ctx.camera.getFrustum().hasSphere(sphereVolume);
-		}
-
-		if(culled) return;
-
 		pbr.lightColor.load(_color);
 		var range = hxd.Math.max(range, 1e-10);
 		var size = hxd.Math.min(size, range);