Browse Source

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 năm trước cách đây
mục cha
commit
ea5c462240
1 tập tin đã thay đổi với 6 bổ sung0 xóa
  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;
         }