Преглед изворни кода

Fix pbr refraction and add test

Gary Hsu пре 6 година
родитељ
комит
0e4583bbdb

+ 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

BIN
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"