Przeglądaj źródła

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 10 lat temu
rodzic
commit
ea5c462240
1 zmienionych plików z 6 dodań i 0 usunięć
  1. 6 0
      Babylon/Lights/babylon.light.ts

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

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