Browse Source

Merge pull request #9776 from Popov72/fix-nme-texture-tolinear

Fix failing webgl1 tests in #9772
David Catuhe 4 years ago
parent
commit
f78465578e
1 changed files with 2 additions and 3 deletions
  1. 2 3
      src/Materials/Node/Blocks/Dual/textureBlock.ts

+ 2 - 3
src/Materials/Node/Blocks/Dual/textureBlock.ts

@@ -360,6 +360,8 @@ export class TextureBlock extends NodeMaterialBlock {
 
         if (state.target === NodeMaterialBlockTargets.Vertex || this._fragmentOnly || (state.target === NodeMaterialBlockTargets.Fragment && this._tempTextureRead === undefined)) {
             this._tempTextureRead = state._getFreeVariableName("tempTextureRead");
+            this._linearDefineName = state._getFreeDefineName("ISLINEAR");
+            this._gammaDefineName = state._getFreeDefineName("ISGAMMA");
         }
 
         if (!this._isMixed && state.target === NodeMaterialBlockTargets.Fragment || this._isMixed && state.target === NodeMaterialBlockTargets.Vertex) {
@@ -390,9 +392,6 @@ export class TextureBlock extends NodeMaterialBlock {
             state._emit2DSampler(this._samplerName);
         }
 
-        this._linearDefineName = state._getFreeDefineName("ISLINEAR");
-        this._gammaDefineName = state._getFreeDefineName("ISGAMMA");
-
         let comments = `//${this.name}`;
         state._emitFunctionFromInclude("helperFunctions", comments);