فهرست منبع

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;
         }