Skip to content

Commit

Permalink
Add 'LinearTosRGB' for backward-compatibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
donmccurdy committed Aug 25, 2023
1 parent d9bdfa1 commit 2e6749a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion examples/jsm/shaders/GammaCorrectionShader.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const GammaCorrectionShader = {
vec4 tex = texture2D( tDiffuse, vUv );
gl_FragColor = LinearTosRGB( tex );
gl_FragColor = sRGBTransferOETF( tex );
}`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,9 @@ vec4 LinearTransferOETF( in vec4 value ) {
vec4 sRGBTransferOETF( in vec4 value ) {
return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );
}
// @deprecated, r156
vec4 LinearTosRGB( in vec4 value ) {
return sRGBTransferOETF( value );
}
`;

0 comments on commit 2e6749a

Please sign in to comment.