Explorar el Código

Merge pull request #7844 from Popov72/master

PBR: Fix bug when translucency is on and an irradiance texture is provided
David Catuhe hace 5 años
padre
commit
3e48cf7029
Se han modificado 2 ficheros con 2 adiciones y 1 borrados
  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;