Skip to content

Commit

Permalink
fix: refractionTransmitted need linear space
Browse files Browse the repository at this point in the history
  • Loading branch information
hhhhkrx committed Feb 10, 2025
1 parent 8f960f8 commit a5fc4c9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/shader-shaderlab/src/shaders/shadingPBR/BTDF.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@

// Sample the opaque texture to get the transmitted light
vec3 refractionTransmitted = texture2D(camera_OpaqueTexture, refractionCoords).rgb;
#ifndef ENGINE_IS_COLORSPACE_GAMMA
refractionTransmitted = gammaToLinear(vec4(refractionTransmitted, 1.0)).rgb;
#endif
refractionTransmitted *= brdfData.diffuseColor;

// Use specularFGD as an approximation of the fresnel effect
Expand Down

0 comments on commit a5fc4c9

Please # to comment.