Explorar el Código

Fix bug in non metallic workflow for the reflectivity block

Popov72 hace 5 años
padre
commit
b1b1e7d02c

+ 2 - 0
src/Shaders/ShadersInclude/pbrBlockReflectivity.fx

@@ -114,6 +114,8 @@ void reflectivityBlock(
         #endif
     #else
         #ifdef REFLECTIVITY
+            surfaceReflectivityColor *= surfaceMetallicOrReflectivityColorMap.rgb;
+
             #if DEBUGMODE > 0
                 outParams.surfaceReflectivityColorMap = surfaceMetallicOrReflectivityColorMap;
             #endif

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

@@ -1,4 +1,4 @@
-#if defined(BUMP) || !defined(NORMAL) || defined(FORCENORMALFORWARD) || defined(SPECULARAA) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC)
+#if defined(BUMP) || !defined(NORMAL) || defined(FORCENORMALFORWARD) || defined(SPECULARAA) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC)
 #extension GL_OES_standard_derivatives : enable
 #endif
 
@@ -132,7 +132,7 @@ void main(void) {
 #if defined(REFLECTIVITY)
     vec4 surfaceMetallicOrReflectivityColorMap = texture2D(reflectivitySampler, vReflectivityUV + uvOffset);
     #ifndef METALLICWORKFLOW
-        surfaceMetallicOrReflectivityColorMap *= toLinearSpace(surfaceMetallicOrReflectivityColorMap);
+        surfaceMetallicOrReflectivityColorMap = toLinearSpace(surfaceMetallicOrReflectivityColorMap);
         surfaceMetallicOrReflectivityColorMap.rgb *= vReflectivityInfos.y;
     #endif
 #endif