three
Version:
JavaScript 3D library
18 lines (10 loc) • 527 B
JavaScript
export default /* glsl */`
vec4 sampledDiffuseColor = texture2D( map, vUv );
// inline sRGB decode (TODO: Remove this code when https://crbug.com/1256340 is solved)
sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );
diffuseColor *= sampledDiffuseColor;
`;