Quellcode durchsuchen

added excludeWithLayerMask to lights. Just tested includeWithLayerMask,
and scene meshes are not affected by 2nd cameras light.

LayerMasked mesh for the 2nd camera ARE affected by the scene lights
though. Usage, first iterate through scene lights, & set
excludeWithLayerMask to the mask being used by the 2nd camera.

jeff Palmer vor 10 Jahren
Ursprung
Commit
ea5c462240
1 geänderte Dateien mit 6 neuen und 0 gelöschten Zeilen
  1. 6 0
      Babylon/Lights/babylon.light.ts

+ 6 - 0
Babylon/Lights/babylon.light.ts

@@ -25,6 +25,7 @@
         public includeOnlyWithLayerMask = 0;
         public includeOnlyWithLayerMask = 0;
         public includedOnlyMeshes = new Array<AbstractMesh>();
         public includedOnlyMeshes = new Array<AbstractMesh>();
         public excludedMeshes = new Array<AbstractMesh>();
         public excludedMeshes = new Array<AbstractMesh>();
+        public excludeWithLayerMask = 0;
 
 
         public _shadowGenerator: ShadowGenerator;
         public _shadowGenerator: ShadowGenerator;
         private _parentedWorldMatrix: Matrix;
         private _parentedWorldMatrix: Matrix;
@@ -69,6 +70,11 @@
                 return false;
                 return false;
             }
             }
 
 
+
+            if (this.excludeWithLayerMask !== 0 && this.excludeWithLayerMask === mesh.layerMask) {
+                return false;
+            }
+
             return true;
             return true;
         }
         }