OpenGL compressed textures and extensions

删除回忆录丶 提交于 2020-02-01 04:48:05

问题


I've an nVidia Quadro NVS 295/PCIe/SSE2 card in which when I do glGetString(GL_EXTENSIONS), print out the values and grep for "compress", I get this list

  • GL_ARB_compressed_texture_pixel_storage
  • GL_ARB_texture_compression
  • GL_ARB_texture_compression_rgtc
  • GL_EXT_texture_compression_dxt1
  • GL_EXT_texture_compression_latc
  • GL_EXT_texture_compression_rgtc
  • GL_EXT_texture_compression_s3tc
  • GL_NV_texture_compression_vtc

But then again glCompressedTexImage2D says that glGet with GL_COMPRESSED_TEXTURE_FORMATS returns the supported compressions, which only gives

  • 0x83f0 = GL_COMPRESSED_RGB_S3TC_DXT1_EXT
  • 0x83f2 = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT
  • 0x83f3 = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT

these three values.

Now why does glGet not expose the other compression formats that my card can process? Say LATC, RGTC or VTC?

Also why am I not seeing corresponding DXT3 or 5 extensions in the first list?


回答1:


Now why does glGet not expose the other compression formats that my card can process?

Because NVIDIA doesn't want to. And really, there's no point. The ARB even decided to deprecate (though not remove) the COMPRESSED_TEXTURE_FORMATS stuff from GL 4.3.

In short, don't rely on that particular glGet. Rely on the extensions. If you have GL 3.0+, then you have the RGTC formats; that's required by GL 3.0+. If you have EXT_texture_compression_s3tc, then you have the "DXT" formats. If you have EXT_texture_sRGB as well, then you have the sRGB versions of the "DXT" formats. And so forth.

Also why am I not seeing corresponding DXT3 or 5 extensions in the first list?

ahem:

  • 0x83f2 = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT
  • 0x83f3 = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT

Those are just different forms of S3TC.




回答2:


why am I not seeing corresponding DXT3 or 5 extensions in the first list?

You are. They're covered by GL_EXT_texture_compression_s3tc.



来源:https://stackoverflow.com/questions/12358863/opengl-compressed-textures-and-extensions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!