diff --git a/packages/core/src/shaderlib/pbr/btdf.glsl b/packages/core/src/shaderlib/pbr/btdf.glsl index e3a82b273..4f337e4e8 100644 --- a/packages/core/src/shaderlib/pbr/btdf.glsl +++ b/packages/core/src/shaderlib/pbr/btdf.glsl @@ -20,6 +20,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 *= material.diffuseColor; // Use specularFGD as an approximation of the fresnel effect