瀏覽代碼

Merge pull request #5844 from sebavan/master

Clear coat fix
David Catuhe 6 年之前
父節點
當前提交
b35e4d20f0
共有 2 個文件被更改,包括 6 次插入4 次删除
  1. 5 3
      src/Materials/PBR/pbrClearCoatConfiguration.ts
  2. 1 1
      tests/validation/config.json

+ 5 - 3
src/Materials/PBR/pbrClearCoatConfiguration.ts

@@ -29,10 +29,12 @@ export interface IMaterialClearCoatDefines {
  */
 export class PBRClearCoatConfiguration {
 
+    @serialize()
+    private _isEnabled = false;
     /**
      * Defines if the clear coat is enabled in the material.
      */
-    @serialize()
+    @expandToProperty("_markAllSubMeshesAsTexturesDirty")
     public isEnabled = false;
 
     /**
@@ -114,7 +116,7 @@ export class PBRClearCoatConfiguration {
      * @param scene defines the scene to the material belongs to.
      */
     public prepareDefines(defines: IMaterialClearCoatDefines, scene: Scene): void {
-        if (this.isEnabled) {
+        if (this._isEnabled) {
             defines.CLEARCOAT = true;
 
             if (defines._areTexturesDirty) {
@@ -158,7 +160,7 @@ export class PBRClearCoatConfiguration {
             }
 
             if (this._bumpTexture && engine.getCaps().standardDerivatives && MaterialFlags.ClearCoatTextureEnabled && !disableBumpMap) {
-                uniformBuffer.updateFloat2("vClearCoatBumpInfos", this._bumpTexture.coordinatesIndex, 1.0 / this._bumpTexture.level);
+                uniformBuffer.updateFloat2("vClearCoatBumpInfos", this._bumpTexture.coordinatesIndex, this._bumpTexture.level);
                 MaterialHelper.BindTextureMatrix(this._bumpTexture, uniformBuffer, "clearCoatBump");
 
                 if (scene._mirroredCameraPosition) {

+ 1 - 1
tests/validation/config.json

@@ -3,7 +3,7 @@
   "tests": [
     {
       "title": "Clear Coat",
-      "playgroundId": "#YACNQS#1",
+      "playgroundId": "#YACNQS#2",
       "referenceImage": "clearCoat.png"
     },
     {