gpt4 book ai didi

opengl - glGenerateMipmap 是否在线性空间中为 sRGB 纹理执行平均?

转载 作者:行者123 更新时间:2023-12-03 23:52:17 29 4
gpt4 key购买 nike

OpenGL 3.3 规范似乎没有要求在线性空间中完成 mipmap 生成。我所能找到的是以下内容:

The internal formats of the derived mipmap arrays all match those of the levelbase array, and the dimensions of the derived arrays follow the requirements described in section 3.8.14. The contents of the derived arrays are computed by repeated, filtered reduction of the levelbase array. For one- and two-dimensional array textures, each layer is filtered independently. No particular filter algorithm is required, though a box filter is recommended as the default filter.



我知道如果原始图像在 sRGB 中,调用 glGenerateMipMap 的结果是在 sRGB 中,我对此没有问题。但中间会发生什么?当然,我们不想平均对数刻度上的颜色。这是特定于实现的吗?

最佳答案

相关答案可以在 OpenGL 规范第 3.8.17 节中找到:

3.8.17 sRGB Texture Color Conversion

If the currently bound texture’s internal format is one of SRGB,SRGB8,SRGB_ALPHA, SRGB8_ALPHA8, COMPRESSED_SRGB, or COMPRESSED_SRGB_ALPHA, the red, green, and blue components are converted from an sRGB color space to a linear color space as part of filtering described in sections 3.8.11 and 3.8.12. Any alpha component is left unchanged. Ideally, implementations should perform this color conversion on each sample prior to filtering but implementations are allowed



Mipmap 生成在第 3.8.11 节中描述,因此受制于颜色空间线性化。

关于opengl - glGenerateMipmap 是否在线性空间中为 sRGB 纹理执行平均?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22348045/

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