根据文档,我可以创建 HDR 压缩纹理,所以我这样做:
funcs->glGenTextures(1, &newCompressedTexture);
funcs->glActiveTexture(GL_TEXTURE0 + g_cTileTextureUnit);
funcs->glBindTexture(GL_TEXTURE_2D, newCompressedTexture);
funcs->glTexStorage2D(GL_TEXTURE_2D, 1, oglTileInfo.m_compressedInternalFormat, g_cTileWidthWithBorder, g_cTileWidthWithBorder);
funcs->glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, g_cTileWidthWithBorder, g_cTileWidthWithBorder, GL_RED, GL_FLOAT, getUncompressedData().rData()._m_data.data());
其中 oglTileInfo.m_compressedInternalFormat 是 GL_COMPRESSED_RED_RGTC1 或 GL_COMPRESSED_RGBA_ASTC_4x4_KHR。没有任何 gl 错误,着色器正常工作,但我通过纹理()获得的值被限制在 [0,1] 及其深度仅为 8 位之间。如果我使用 GL_R32F 作为纹理内部格式,一切正常,但我需要压缩。谢谢。