作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
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/
我是一名优秀的程序员,十分优秀!