当纹理处于伽马颜色空间时,sRGB 采样允许 Unity Editor 在线性颜色空间中渲染着色器。当您选择使用线性颜色空间时,Editor 默认使用 sRGB 采样。如果纹理处于线性颜色空间,则需要使用线性颜色空间并为每个纹理禁用 sRGB 采样。要了解如何执行此操作,请参阅以下的禁用 sRGB 采样。
如需进一步阅读这方面的信息,请参阅以下相关文档:
对旧版 GUI 系统元素的渲染始终在伽马空间中完成。这意味着,对于旧版 GUI 系统,__Texture Type__ 设置为 Editor GUI and Legacy GUI 的纹理在导入时不会移除其伽马校正。
同样重要的是,如果查找纹理、遮罩和其他纹理存在有特殊意义且未应用伽马校正的 RGB 值,则必须绕过 sRGB 采样。这样可以防止被采样纹理的值在用于着色器之前删除不存在的伽马校正,确保使用磁盘上存储的原始值进行计算。Unity 假设 GUI 纹理和法线贴图纹理都是在线性空间中创作的。
为确保将纹理作为线性颜色空间图像导入,请在纹理的 Inspector 窗口中执行以下操作:
为纹理的预期用途选择适当的 Texture Type。
取消选中 sRGB (Color Texture)(如果显示了此选项)。
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.