PDA

View Full Version : GL_EXT_shared_texture_palette



Melekor
11-12-2002, 02:03 PM
GL_EXT_shared_texture_palette:

Ok, I've had this topic in the beginners forum for more than a week now and no one seems to know there, so does anyone here know how to use this extension?
*actual source would be great*

thanks

Asgard
11-12-2002, 02:17 PM
Firstly, the spec is all you need to understand the extension. Grab it from http://oss.sgi.com/projects/ogl-sample/registry/

As for source code using the extension, I think it's probably one of the easiest, if not _the_ easiest, extensions out there (compared to monsters like ARB_vertex_program).
When you call glEnable(GL_SHARED_TEXTURE_PALETTE_EXT) the shared texture palette is used instead of the per-texture object palette. Calling glDisable will disable this again. It's as simple as that http://www.opengl.org/discussion_boards/ubb/smile.gif

Edit: Fixed two typos.

[This message has been edited by Asgard (edited 11-12-2002).]

Melekor
11-12-2002, 02:49 PM
so as I understand you, once you call
glEnable(GL_SHARED_TEXTURE_PALETTE_EXT), in your render loop you can say


glColorSubTable(..)
*draw all objects needing that palette*
glColorSubTable(..)
*draw all objects needing that palette*

is this correct or do you have to define which textures use which palette at load time or something?

Asgard
11-12-2002, 03:38 PM
so as I understand you, once you call
glEnable(GL_SHARED_TEXTURE_PALETTE_EXT), in your render loop you can say

That glEnable just switches the texture palette to be the shared texture palette.


is this correct or do you have to define which textures use which palette at load time or something?

I don't really know what you want to do exactly. Palettes as defined in EXT_paletted_textures are per-texture object state. The shared palette can be used to quickly change the palette for more textures that use the same palette (that is, the shared palette) at once.

To change the shared palette, pass in GL_SHARED_TEXTURE_PALETTE_EXT as target parameter to the glColorTable routines.



[This message has been edited by Asgard (edited 11-12-2002).]

Melekor
11-12-2002, 03:47 PM
thanks! I'll try some stuff out and post back with my results later.

Melekor
11-12-2002, 06:19 PM
Yes! it works! Thanks so much http://www.opengl.org/discussion_boards/ubb/smile.gif
The effect is spectacular, I can e-mail it to you if you want. Just tell me if you do.