
Texture Compression - PixelInternalFormat
Posted Sunday, 29 March, 2009 - 18:57 by Grasshopper inI would like to use this texture compression:
(http://oss.sgi.com/projects/ogl-sample/registry/EXT/texture_compression_...)
COMPRESSED_RGB_S3TC_DXT1_EXT
But there seems to be no enum for it?
Additionally I checked the extensions for "GL_EXT_texture_compression_s3tc" and I have that but
GL.GetInteger(GetPName.NumCompressedTextureFormats, out numFormats);
gives me 0 formats.
Any ideas?


Comments
Re: Texture Compression - PixelInternalFormat
PixelInternalFormat.CompressedRgbaandCompressedTexImage2Dseems to work fine here.If you wish to use a non-core token (ending in _ARB or _EXT, etc), you'll have to cast it from the
Allenum.Re: Texture Compression - PixelInternalFormat
You have to cast explicitly atm, only the sRGB s3tc formats are available in the InternalFormat enum. (Don't ask me why)
http://www.opentk.com/node/393
Edit: Getting old it seems -.-
Re: Texture Compression - PixelInternalFormat
How widely supported is the texture compression algorithms..? I'm thinking if I should just have it as default in my TexUtil-class..
Re: Texture Compression - PixelInternalFormat
Support is superb, it's even available on Intel hardware. (!!!!)
But you should consider reading http://www.opentk.com/doc/chaper/3/S3_Texture_Compression
Re: Texture Compression - PixelInternalFormat
Whoa even Intel :)
Thx I'll check it out Inertia!
Re: Texture Compression - PixelInternalFormat
Pretty much everything from the last 10 years supports using compressed textures. Only some drivers support compressing uncompressed textures on the fly. Software Mesa3D supports neither.
Note that compressed textures with high frequency details tend to have noticeably worse appearance (and noticeably better performance).
See page 125 of the specs for the table of supported (core) compressed formats. S3TC is not among of those - is there any good reason why use that instead of the core formats?
Re: Texture Compression - PixelInternalFormat
Argh -- I'm on VirtualBox+WinXP on a Ubuntu computer, so I guess I'm using software Mesa (Generic GDI is the renderer name) when testing my progs virtually.
That might prove to be a "stumbling block" for the development of games for me, if I wanted to use compressed textures. (to much hassle flipping back-and-front to the host OS all the time to test the compiled program)
Re: Texture Compression - PixelInternalFormat
Even worse, you are on Microsoft's GDI renderer.
Install the latest VirtualBox and enable accelerated 3d in your virtual machine settings. VirtualBox 2.1.4 supports OpenGL 1.5 (including compressed textures IIRC) and VirtualBox 2.2 (beta) supports something like OpenGL 2.0. Much better.
Re: Texture Compression - PixelInternalFormat
Inertia - I read through most of the book page, nice explanation!
So if I understand the book page correctly - to use compressed textures, I have to convert my .png-files to .dds files?
Re: Texture Compression - PixelInternalFormat
For best performance and quality, yes. You can also have the driver compress the texture on the fly, but a) this is going to impact your loading performance and b) on the fly compression is not supported by open-source drivers (due to patents on the compression format).
Personally, I compress all my textures with gimp before adding them to the project (don't forget to keep the originals around in case you want to tweak the texture later on!) Quake 3 / Doom 3, on the other hand, compress on the fly.