소스 검색

Merge pull request #2532 from vanRepin/master

fix getActiveTextures for pbrBaseSimpleMaterial
David Catuhe 8 년 전
부모
커밋
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