瀏覽代碼

Fix pbr refraction and add test

Gary Hsu 6 年之前
父節點
當前提交
0e4583bbdb
共有 3 個文件被更改,包括 6 次插入1 次删除
  1. 1 1
      src/Materials/PBR/pbrBaseMaterial.ts
  2. 二進制
      tests/validation/ReferenceImages/pbr_refraction.png
  3. 5 0
      tests/validation/config.json

+ 1 - 1
src/Materials/PBR/pbrBaseMaterial.ts

@@ -1790,7 +1790,7 @@ export abstract class PBRBaseMaterial extends PushMaterial {
                 this._uniformBuffer.updateColor3("vEmissiveColor", MaterialFlags.EmissiveTextureEnabled ? this._emissiveColor : Color3.BlackReadOnly);
                 this._uniformBuffer.updateColor3("vReflectionColor", this._reflectionColor);
 
-                const alpha = this._disableAlphaBlending ? mesh.visibility : this.alpha * mesh.visibility;
+                const alpha = (this._transparencyMode === PBRBaseMaterial.PBRMATERIAL_OPAQUE) ? mesh.visibility : this.alpha * mesh.visibility;
                 this._uniformBuffer.updateColor4("vAlbedoColor", this._albedoColor, alpha);
 
                 // Misc

二進制
tests/validation/ReferenceImages/pbr_refraction.png


+ 5 - 0
tests/validation/config.json

@@ -483,6 +483,11 @@
       "referenceImage": "pbr.png"
     },
     {
+      "title": "PBR refraction",
+      "playgroundId": "#LCA0Q4#25",
+      "referenceImage": "pbr_refraction.png"
+    },
+    {
       "title": "Texture cache",
       "playgroundId": "#20OAV9#237",
       "referenceImage": "texture cache.png"