瀏覽代碼

Merge pull request #7844 from Popov72/master

PBR: Fix bug when translucency is on and an irradiance texture is provided
David Catuhe 5 年之前
父節點
當前提交
3e48cf7029
共有 2 個文件被更改,包括 2 次插入1 次删除
  1. 1 0
      dist/preview release/what's new.md
  2. 1 1
      src/Shaders/pbr.fragment.fx

+ 1 - 0
dist/preview release/what's new.md

@@ -79,5 +79,6 @@
 - Fix bug in `Plane.transform` when matrix passed in is not a pure rotation ([Popov72](https://github.com/Popov72)
 - Fix bug in PBR when anisotropy is enabled and no bump texture is provided ([Popov72](https://github.com/Popov72)
 - Fix horizon occlusion in PBR materials ([Popov72](https://github.com/Popov72)
+- Fix bug in PBR when translucency is enabled and an irradiance texture is provided ([Popov72](https://github.com/Popov72)
 
 ## Breaking changes

+ 1 - 1
src/Shaders/pbr.fragment.fx

@@ -1040,7 +1040,7 @@ void main(void) {
 
     // _______________________________  IBL Translucency ________________________________
     #if defined(REFLECTION) && defined(SS_TRANSLUCENCY)
-        #if defined(USESPHERICALINVERTEX)
+        #if defined(NORMAL) && defined(USESPHERICALINVERTEX) || !defined(USESPHERICALFROMREFLECTIONMAP)
             vec3 irradianceVector = vec3(reflectionMatrix * vec4(normalW, 0)).xyz;
             #ifdef REFLECTIONMAP_OPPOSITEZ
                 irradianceVector.z *= -1.0;