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

Merge pull request #2532 from vanRepin/master

fix getActiveTextures for pbrBaseSimpleMaterial
David Catuhe 8 лет назад
Родитель
Сommit
8e50c9a5f9
1 измененных файлов с 25 добавлено и 0 удалено
  1. 25 0
      src/Materials/PBR/babylon.pbrBaseSimpleMaterial.ts

+ 25 - 0
src/Materials/PBR/babylon.pbrBaseSimpleMaterial.ts

@@ -163,6 +163,31 @@
         }
 
         /**
+         * Return the active textures of the material.
+         */
+        public getActiveTextures(): BaseTexture[] {
+            var activeTextures = super.getActiveTextures();
+
+            if (this.environmentTexture) {
+                activeTextures.push(this.environmentTexture);
+            }
+
+            if (this.normalTexture) {
+                activeTextures.push(this.normalTexture);
+            }
+
+            if (this.emissiveTexture) {
+                activeTextures.push(this.emissiveTexture);
+            }
+
+            if (this.occlusionTexture) {
+                activeTextures.push(this.occlusionTexture);
+            }
+
+            return activeTextures;
+        }
+
+        /**
          * Instantiates a new PBRMaterial instance.
          * 
          * @param name The material name