浏览代码

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 年之前
父节点
当前提交
ea5c462240
共有 1 个文件被更改,包括 6 次插入0 次删除
  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;
         }