Просмотр исходного кода

named values for light.lightmapMode

László Matuska 9 лет назад
Родитель
Сommit
7ce0d2b9a8
1 измененных файлов с 37 добавлено и 0 удалено
  1. 37 0
      src/Lights/babylon.light.ts

+ 37 - 0
src/Lights/babylon.light.ts

@@ -21,6 +21,43 @@
     }
 
     export class Light extends Node {
+
+        private static _LIGHTMAP_DEFAULT = 0;
+
+        //
+        private static _LIGHTMAP_SPECULAR = 1;
+
+        //
+        private static _LIGHTMAP_NONE = 2;
+
+        /**
+         * If every light affecting the material is in this lightmapMode,
+         * material.lightmapTexture adds or multiplies
+         * (depends on material.useLightmapAsShadowmap)
+         * after every other light calculations.
+         */
+        public static get LIGHTMAP_DEFAULT(): number {
+            return Light._LIGHTMAP_DEFAULT;
+        }
+
+        /**
+         * material.lightmapTexture as only diffuse lighting from this light
+         * adds pnly specular lighting from this light
+         * adds dynamic shadows
+         */
+        public static get LIGHTMAP_SPECULAR(): number {
+            return Light._LIGHTMAP_SPECULAR;
+        }
+
+        /**
+         * material.lightmapTexture as only lighting
+         * no light calculation from this light
+         * only adds dynamic shadows from this light
+         */
+        public static get LIGHTMAP_NONE(): number {
+            return Light._LIGHTMAP_NONE;
+        }
+
         @serializeAsColor3()
         public diffuse = new Color3(1.0, 1.0, 1.0);