Unity Editor 允许您使用传统的伽马颜色空间以及线性颜色空间。伽马颜色空间是历史悠久的标准格式,但线性颜色空间渲染可提供更精确的结果。
如需进一步阅读这方面的信息,请参阅以下相关文档:
人眼对光强的反应不呈线性。我们在观察光时会发现一些亮度比另一些亮度更容易看到,即从黑到白的线性渐变在我们人眼中不是线性渐变的。
由于历史原因,监视器和显示器具有相同的特性。向监视器发送线性信号会导致看起来像上图右侧的渐变,人眼观察感觉是错误的。为了弥补这一点,需要发送经校正的信号来确保监视器能够呈现出看起来自然的图像。这种校正称为伽马校正。
伽马和线性颜色空间同时存在的原因是,光照计算应该在线性空间中进行,以便确保数学上的正确性,但结果应该在伽马空间中呈现以便让人眼看起来正确。
在帧缓冲格式限制为每通道 8 位的旧硬件上,计算光照时使用伽马曲线可在人类可感知的范围内提供更高的精度。在人眼最敏感的范围内,使用的位数最多。
即使当今的监视器是数字显示器,它们仍然采用伽马编码信号作为输入信号。图像文件和视频文件显式编码到伽马空间(这意味着它们带有伽马编码值,而不是线性强度)。这便是标准;一切数值都在伽马空间内。
伽马空间的公认标准称为 sRGB(请参阅 Wikipedia)。该标准定义了它与线性空间之间的一个映射,使得人眼能充分利用 8 位/通道的精度。
线性渲染指的是渲染场景的过程,此情况下的所有输入都是线性的,也就是说,没有经过伽马校正以适合人眼观察或输出到显示器。
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.