Browse Source

Fix bug when translucency is enabled and an irradiance texture is provided

Popov72 5 năm trước cách đây
mục cha
commit
52269ec2ac
2 tập tin đã thay đổi với 2 bổ sung1 xóa
  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;