UDN
Search public documentation:
GammaCorrection
日本語訳
中国翻译
한국어
Interested in the Unreal Engine?
Visit the Unreal Technology site.
Looking for jobs and company info?
Check out the Epic games site.
Questions about support via UDN?
Contact the UDN Staff
中国翻译
한국어
Interested in the Unreal Engine?
Visit the Unreal Technology site.
Looking for jobs and company info?
Check out the Epic games site.
Questions about support via UDN?
Contact the UDN Staff
Gamma Correction in UE3
Document Changelog: Created by Daniel Wright.
Overview
- To compensate for various monitor's non-linear response (output luminance is not proportional to input intensity).
- To get better precision in the darks where it matters most when colors need to be quantized, as the human eye is more sensitive to small changes in dark colors than detail in light colors.
Gamma in UE3
- Input color textures are stored in gamma space (diffuse, specular, etc) to get better precision in the darks. These textures are sampled with sRGB read (D3DSAMP_SRGBTEXTURE in D3D9) which does the conversion from gamma to linear space for free, using the graphics hardware. This is controlled with the SRGB UTexture property.
- Once we have the linear space color, it can be used in various lighting equations with the expected linear result.
- The scene color render target stores linear color. This is important because it means that alpha blending happens in linear space. If we stored scene color in gamma space, alpha blending would happen in that color space and the results would be very different from what you would expect. The downside to storing scene color in linear space is that it needs significantly more precision, an FP 16 render target is necessary to avoid banding in the darks.
- At the end of the post process chain, linear scene color is gamma corrected BEFORE writing scene color to an 8 bit per pixel render target/backbuffer. This is the standard gamma correction to compensate for the non-linear response of common monitors. This happens in UberPostProcessBlendPixelShader.usf or GammaCorrectionPixelShader.usf if there is no UberPostProcess node in the post process chain.
Gamma on Mobile

To Enable Mobile Gamma Correction
Gamma correction on mobile platforms is not enabled by default. To make use of gamma correction for mobile games, enable the Use Gamma Correction property in the World Properties for your map(s).