Browse Source

Don't push two times the same sampler name

Popov72 4 năm trước cách đây
mục cha
commit
be2b2a7a6f
1 tập tin đã thay đổi với 4 bổ sung2 xóa
  1. 4 2
      src/Materials/Node/nodeMaterialBuildState.ts

+ 4 - 2
src/Materials/Node/nodeMaterialBuildState.ts

@@ -171,8 +171,10 @@ export class NodeMaterialBuildState {
 
     /** @hidden */
     public _emit2DSampler(name: string) {
-        this._samplerDeclaration += `uniform sampler2D ${name};\r\n`;
-        this.samplers.push(name);
+        if (this.samplers.indexOf(name) < 0) {
+            this._samplerDeclaration += `uniform sampler2D ${name};\r\n`;
+            this.samplers.push(name);
+        }
     }
 
     /** @hidden */