gpt4 book ai didi

opengl - GL_SRGB8_ALPHA8 对纹理插值的影响?

转载 作者:行者123 更新时间:2023-12-02 00:46:35 25 4
gpt4 key购买 nike

OpenGL 允许使用 GL_SRGB8_ALPHA8 将纹理声明为 sRGB(图像通常如此),这将导致 OpenGL 在对 GLSL 中的纹理进行采样时将 sRGB 颜色转换为线性 RGB 空间.这也称为“ Gamma 校正”。

我还读到,纹理中的线性插值与 GL_SRGB8_ALPHA8 的行为不同,因为据推测插值也会发生在线性空间中。如果有的话,这有什么影响?这是否意味着应该始终对纹理使用 GL_SRGB8_ALPHA8,而不是通过 GLSL 进行自己的 sRGB -> 线性转换?

最佳答案

作为旁注,这就是 OpenGL 4.5 core profile specification 的内容不得不说一下(引用自“8.24 sRGB 纹理颜色转换”部分):

Ideally, implementations should perform this color conversion on each sample prior to filtering but implementations are allowed to perform this conversion after filtering (though this post-filtering approach is inferior to converting from sRGB prior to filtering).

所以规范不能保证你的行为是理想的。

关于opengl - GL_SRGB8_ALPHA8 对纹理插值的影响?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43333530/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com