• Gamma Correction


    Gamma Correction

      磁盘上存储的纹理可分为Linear Texture、Gamma Texture。

       

      

      sRGB sampling allows the Unity Editor to render Shaders in linear color space when Textures are in gamma color space. When you select to work in linear color space, the Editor defaults to using sRGB sampling. If your Textures are in linear color space, you need to work in linear color space and disable sRGB sampling for each Texture. 

      当使用 linear color space时, Editor默认使用sRGB sampling。此时,对于linear color space的texture,需要取消 sRGB选项。

      Textures tend to be saved in gamma color space, while Shaders expect linear color space. As such, when Textures are sampled in Shaders, the gamma-based values lead to inaccurate results. To overcome this, you can set Unity to use an RGB sampler to cross over from gamma to linear sampling. This ensures a linear workflow with all inputs and outputs of a Shader in the correct color space, resulting in a correct outcome.

      lookup Textures, Masks Texture, GUI, Normal Texture

      表纹理,遮罩纹理,GUI纹理,法线都按是Linear纹理。

      下图中,当sRGB被勾选时,Unity将纹理视为Gamma Textrue;未勾选时,将纹理视为Linear Texture。

      

      模式:

      1、sRGB,不会对Texture采样进行任何处理,也不会对shader的输出进行任何处理。

      2、Linear,会对Texture采样进行处理(非线性-> 线性),也会对shader的输出进行处理(线性->非线性)。而Gamma Mode不会有这两个处理。

    参考:

    1、https://docs.unity3d.com/Manual/LinearRendering-LinearTextures.html#DisablingsRGBSampling

    2、https://blog.csdn.net/radiocat520/article/details/52514961

    3、https://zhuanlan.zhihu.com/p/33637724

  • 相关阅读:
    day10
    day 09
    day08
    day07
    day6
    day5
    成员变量和局部变量
    (第五章)java面向对象之this的作用总结
    简单的音乐播放
    异步消息处理机制 简析
  • 原文地址:https://www.cnblogs.com/tekkaman/p/8360563.html
Copyright © 2020-2023  润新知