PDA

View Full Version : Compressed Textures - any out there?



bentlegen
08-10-2004, 05:18 AM
Greetings,

Is there a tool out there that compresses textures in one of the paletted OES formats? i.e. GL_PALETTE4_RGBA4_OES

Or, fail that, a collection of textures in those formats?

- Ben

hmwill
08-10-2004, 09:06 AM
I actually asked the question in another forum, and the answer is yes (http://www.pocketmatrix.com/forums/viewtopic.php?t=17527).

- HM

bentlegen
08-10-2004, 10:18 AM
Thanks Hans - you're an invaluable member of this board.

- Ben

bentlegen
08-10-2004, 11:13 AM
Quick amendment - I take it then that you had not finished implementing support for these textures before passing the conformance tests with Vincent.

Does this mean that the OES formats need not be supported, but handled gracefully, or something along those lines?

- Ben

hmwill
08-10-2004, 01:00 PM
Compressed textures are supported. However, at this point they are expanded into the closest base internal format that is actually supported by the rasterizer core (instead of having the rasterizer itself use the palette during the actual lookup of texels).

Having the rasterizer resolve palettes should speed up things remarkably.

- HM

PS: Thanks!

bentlegen
08-11-2004, 02:46 AM
I understand - but I meant that, even if you were converting these textures to whatever internal format, there's something like 10+ different paletted types defined in OES that you must have tested? Or did you just assume that all was well and kosher with your converting algorithm? ;)

- Ben

hmwill
08-11-2004, 07:13 AM
All formats defined are tested...

- HM

mike260
08-11-2004, 07:17 AM
<BLOCKQUOTE><font size="1" face="Arial, Verdana, Helvetica, sans-serif">quote:</font><HR>Is there a tool out there that compresses textures in one of the paletted OES formats?<HR></BLOCKQUOTE>

In addition to Hans' link, I should point out that photoshop does an astonishingly good job of palettising images. A while ago I wrote a hextree-based palettiser, and was very pleased with myself until I compared my output to photoshops - there was no comparison whatsoever.

The disadvantages are (1) photoshop's expensive, (2) you can't control it from the commandline so it may not fit into your art pipeline very well, and (3) I'm not sure if it handles alpha-channels.

bentlegen
08-12-2004, 02:28 AM
I guess I'm confused - does glCompressedTextures "take" a compressed texture, in the format designated, or does it create one?

I guess the internalFormat paramater confuses me most. It suggests to me that this is the desired internal format of the texture, not the incoming format referenced by the data pointer.

Thoughts?

- Ben

mike260
08-12-2004, 03:02 AM
<BLOCKQUOTE><font size="1" face="Arial, Verdana, Helvetica, sans-serif">quote:</font><HR>Originally posted by bentlegen:
I guess I'm confused - does glCompressedTextures "take" a compressed texture, in the format designated, or does it create one?<HR></BLOCKQUOTE>

glCompressedTexImage*D always takes pre-compressed texture data - it's up to you to compress it. The 'internalformat' parameter specifies the format of the texture-data you're passing into the function; it certainly does look a bit mis-named.

Normally, the way to get OpenGL to do the compression for you is to use glTexImage*D, specifying a compressed internalformat. You can then read the compressed texture back out, which will be suitable for use with glCompressedTexImage*D.

However, you can't do this for paletted textures so that's useless to you. Sorry.