Jump to content
  • Advertisement
Sign in to follow this  
-opTreX-

OpenGL OpenGL and palettes

This topic is 4102 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi there! Is there a fast method or way to simulate 8-bit palettes (more than one would be nice) in 16/24/32-bit graphics mode which works on almost all graphic adapters? (Hardware-) Palettes are only hardware accelerated in 8-bit mode, isn't it? (Sorry for my english.) Platform: Windows -opTreX-

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Palettes are only hardware accelerated in 8-bit mode, isn't it?

no 16bit + higher are supported but be aware
palettes arent accelrated at all with new cards in hardware, ie support is dropped.
a possible method to simulate is to use say a 256x1 texture (containing the palette colors) with GL_NEAREST filtering

Share this post


Link to post
Share on other sites
Thanks zedz!

Do you mean the glColorTableEXT extension? If yes, is it supported by all drivers? If not, how does OpenGL read the colors from the 1D palette texture (256x1) and set the colors in the other textures?

Is there a tutorial about 8-bit palettes in 16/24/32-bit graphics mode or an open source game which uses pure Win32 OpenGL and 8-bit palettes?

-opTreX-

Share this post


Link to post
Share on other sites
Forget about palettes. It hasn't been around for 5 years and more. Use full color textures and use DXT texture compression.

Share this post


Link to post
Share on other sites
no not glColorTableEXT

create a 256x1 texture with the pallette colors in a pain program, save it load it up iin the ogl program bind tahta texture


-- vertex shader--

tc = 10.0 / 256.0; // thus acceses the color 10 pixels along in the texture (which is 256pixels wide)


-- fragment shader--

color = texture2d( palette_texture, tc );

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!