瀏覽代碼

Merge pull request #6523 from sebavan/master

Fix Alpha changes detection for dirty defines
David Catuhe 6 年之前
父節點
當前提交
e78954fa10
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      src/Materials/PBR/pbrBaseMaterial.ts

+ 4 - 2
src/Materials/PBR/pbrBaseMaterial.ts

@@ -1475,13 +1475,15 @@ export abstract class PBRBaseMaterial extends PushMaterial {
                 defines.TWOSIDEDLIGHTING = false;
             }
 
+            defines.SPECULARAA = scene.getEngine().getCaps().standardDerivatives && this._enableSpecularAntiAliasing;
+        }
+
+        if (defines._areTexturesDirty || defines._areMiscDirty) {
             defines.ALPHATESTVALUE = `${this._alphaCutOff}${this._alphaCutOff % 1 === 0 ? "." : ""}`;
             defines.PREMULTIPLYALPHA = (this.alphaMode === Constants.ALPHA_PREMULTIPLIED || this.alphaMode === Constants.ALPHA_PREMULTIPLIED_PORTERDUFF);
             defines.ALPHABLEND = this.needAlphaBlendingForMesh(mesh);
             defines.ALPHAFRESNEL = this._useAlphaFresnel || this._useLinearAlphaFresnel;
             defines.LINEARALPHAFRESNEL = this._useLinearAlphaFresnel;
-
-            defines.SPECULARAA = scene.getEngine().getCaps().standardDerivatives && this._enableSpecularAntiAliasing;
         }
 
         if (defines._areImageProcessingDirty && this._imageProcessingConfiguration) {