Skip to content

Commit a5fc4c9

Browse files
committed
fix: refractionTransmitted need linear space
1 parent 8f960f8 commit a5fc4c9

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

  • packages/shader-shaderlab/src/shaders/shadingPBR

packages/shader-shaderlab/src/shaders/shadingPBR/BTDF.glsl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323

2424
// Sample the opaque texture to get the transmitted light
2525
vec3 refractionTransmitted = texture2D(camera_OpaqueTexture, refractionCoords).rgb;
26+
#ifndef ENGINE_IS_COLORSPACE_GAMMA
27+
refractionTransmitted = gammaToLinear(vec4(refractionTransmitted, 1.0)).rgb;
28+
#endif
2629
refractionTransmitted *= brdfData.diffuseColor;
2730

2831
// Use specularFGD as an approximation of the fresnel effect

0 commit comments

Comments
 (0)