Browse Source

fix getActiveTextures for pbrBaseSimpleMaterial

Ivan Repin 8 years ago
parent
commit
71e7fe6522
1 changed files with 25 additions and 0 deletions
  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.
          * Instantiates a new PBRMaterial instance.
          * 
          * 
          * @param name The material name
          * @param name The material name