OpenGL Learning Footprints: Gamma correction (gamma Correction)

Source: Internet
Author: User
OpenGL Learning Footprints: Gamma correction (gamma Correction): http://blog.csdn.net/wangdingqiaoit/article/details/52974486
Summarize:
1. CRT gamma, Cout = Cin ^ 2.2, because the color RGB is [0,1] so, 0.5^2.2 = 0.218 Therefore, the Gamma of the CRT display is smaller.
2. Gamma correction (gamma Correction) is the inverse process of CRT gamma, Cout = Cin ^ (1/2.2).
3. The color of the texture-preserving RGB is mostly preprocessed, and the stored color information is already gamma corrected, i.e. Cout = Cin ^ (1/2.2).
4. When OpenGL constructs a texture object, it indicates that the internal format of the texture is sRGB, which is what we call the corrected non-linear color, and OpenGL will automatically convert it to linear space when indicated as described above, that is, if the specified texture format is sRGB, Then it means that the color information stored in this texture is already gamma corrected, Cout = Cin ^ (1/2.2), then OpenGL uses this texture when it does Cout = Cin ^ 2.2, which gets the linear RGB color information.


Unity3d's Gamma,linear
Reference: [Unity3d] Summary gamma Space and linear space:http://blog.csdn.net/ngrandmarch/article/details/46407017

1. When the gamma color space is selected, whether or not the texture sRGB is checked, unity defaults to using the texture's original color, which means that the stored color information is already gamma corrected, and unity does not automatically handle the results of the operation in shader.
2. When choosing a linear color space,
Texture sRGB checked the case, then in the shader sampling time, the texture color will be processed, will be from the Gamma-and Linear, so the color is Linear after sampling, using Linear color to calculate, After the shader operation results, the GPU automatically processes the results of the operation, Linear-Gamma.

Texture sRGB did not tick the case, then in the shader sampling, get the gamma color, in the shader operation, with the gamma color, and finally, the GPU automatically processing the results of the operation, Gamma, Gamma, The result here is that the color of the output is enhanced.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.