Ver código fonte

Merge pull request #9722 from CraigFeldspar/albedo-sss

Subsurfacescattering : fixing irradiance negative value when having a metallic texture
sebavan 4 anos atrás
pai
commit
339716c49c
1 arquivos alterados com 1 adições e 1 exclusões
  1. 1 1
      src/Shaders/pbr.fragment.fx

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

@@ -567,7 +567,7 @@ void main(void) {
             float scatteringDiffusionProfile = 255.;
             float scatteringDiffusionProfile = 255.;
         #endif
         #endif
 
 
-        gl_FragData[PREPASS_IRRADIANCE_INDEX] = vec4(irradiance, scatteringDiffusionProfile / 255.); // Irradiance + SS diffusion profile
+        gl_FragData[PREPASS_IRRADIANCE_INDEX] = vec4(clamp(irradiance, vec3(0.), vec3(1.)), scatteringDiffusionProfile / 255.); // Irradiance + SS diffusion profile
     #else
     #else
         gl_FragData[0] = vec4(finalColor.rgb, finalColor.a);
         gl_FragData[0] = vec4(finalColor.rgb, finalColor.a);
     #endif
     #endif