소스 검색

Fix pbr refraction and add test

Gary Hsu 7 년 전
부모
커밋
0e4583bbdb
3개의 변경된 파일6개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/Materials/PBR/pbrBaseMaterial.ts
  2. BIN
      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

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"