Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenGL compressed textures and extensions

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?

like image 393
legends2k Avatar asked Sep 10 '12 20:09

legends2k


2 Answers

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.

like image 53
Nicol Bolas Avatar answered Oct 18 '22 06:10

Nicol Bolas


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.

like image 45
genpfault Avatar answered Oct 18 '22 08:10

genpfault