浏览代码

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

Fix failing webgl1 tests in #9772
David Catuhe 4 年之前
父节点
当前提交
f78465578e
共有 1 个文件被更改,包括 2 次插入3 次删除
  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);