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

lightmapMode constants in materialHelper.ts

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

+ 4 - 7
src/Lights/babylon.light.ts

@@ -22,13 +22,10 @@
 
     export class Light extends Node {
 
+        //lightmapMode Consts
         private static _LIGHTMAP_DEFAULT = 0;
-
-        //
         private static _LIGHTMAP_SPECULAR = 1;
-
-        //
-        private static _LIGHTMAP_NONE = 2;
+        private static _LIGHTMAP_SHADOWSONLY = 2;
 
         /**
          * If every light affecting the material is in this lightmapMode,
@@ -54,8 +51,8 @@
          * no light calculation from this light
          * only adds dynamic shadows from this light
          */
-        public static get LIGHTMAP_NONE(): number {
-            return Light._LIGHTMAP_NONE;
+        public static get LIGHTMAP_SHADOWSONLY(): number {
+            return Light._LIGHTMAP_SHADOWSONLY;
         }
 
         @serializeAsColor3()

+ 2 - 2
src/Materials/babylon.materialHelper.ts

@@ -104,7 +104,7 @@
                     }
                 }
 
-                if (light.lightmapMode != 0 ) {
+                if (light.lightmapMode != Light.LIGHTMAP_DEFAULT ) {
                     lightmapMode = true;
                     if (defines["LIGHTMAPEXCLUDED" + lightIndex] === undefined) {
                         needRebuild = true;
@@ -113,7 +113,7 @@
                         needRebuild = true;
                     }
                     defines["LIGHTMAPEXCLUDED" + lightIndex] = true;
-                    if (light.lightmapMode == 2) {
+                    if (light.lightmapMode == Light.LIGHTMAP_SHADOWSONLY) {
                         defines["LIGHTMAPNOSPECULAR" + lightIndex] = true;
                     }
                 }