sRGBTransferOETF
Encodes a physically correct linear color, typically the result of rendering calculations, into the sRGB color space for correct presentation on a monitor, usually as the final step in the pipeline.
Core Advantages
Ensures the final image has the correct brightness and contrast on screen by applying standard "gamma correction," translating physically accurate render results into a visually correct picture.
Common Uses
Encoding the final render output for display on the screen, its primary use.
Applying color encoding when saving render results to standard image files (e.g., PNG, JPG).
Previewing how a linear color value will actually appear on screen during shader development.
How to adjust
This is a fixed mathematical function with no adjustable parameters. Its role is definitive and must be the final step in color processing. Applying it incorrectly before operations like color blending will cause incorrect results, such as a mix of red and green becoming dark and muddy instead of a physically correct bright yellow.
Code Examples
1// Assume linearColorInput is the linear color after lighting (physical mid-gray)
2const linearColorInput = uniform( vec3( 0.214, 0.214, 0.214 ) );
3
4// Convert it from linear to sRGB space for correct display (visual mid-gray)
5const sRGBColorOutput = sRGBTransferOETF( linearColorInput );