浏览代码

fix getActiveTextures for pbrBaseSimpleMaterial

Ivan Repin 8 年之前
父节点
当前提交
71e7fe6522
共有 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