Iris2.de
http://iris2.de/forum/

Palette Swapping
http://iris2.de/forum/viewtopic.php?f=16&t=1127
Page 1 of 1

Author:  Avictus [ Sat Oct 27, 2007 4:28 pm ]
Post subject:  Palette Swapping

I was curious as to how you implemented palette swapping in your 2D engine. Do you just reload the resource with the new palette, or do you somehow change the colors of the already loaded resource?

The reason I ask, is that I'd like to implement something like this, but modern hardware doesn't seem to support palette swapping. I could reload the resources and fill the information in, but that seems slow and wasteful. It would be better if I could change the "palette" of an already loaded texture. I've been looking around the net, but the only articles I can find on palette swapping in OpenGL are using techniques that aren't supported in hardware anymore.

I'm sorry I keep asking questions here, but you guys have already been through making an isometric 2D engine, so I figured you'd be the most likely to help me.

Once again, thank you in advance for any help you can give. I really appreciate it.

Author:  hagish [ Sat Oct 27, 2007 4:50 pm ]
Post subject: 

yes, for the 2d graphics we create one resource for each coloring of an object. its just a graphic with the palette applied that is used for all objects of the given type and color. thats mainly because the old 2d uo client worked this way.
for the 3d objects we blend one color over a gray texture. this works quite well and fast, but you can use only on color for the object (if you don't use masks and multi-textures).

Author:  Avictus [ Sat Oct 27, 2007 4:55 pm ]
Post subject: 

Dang, that was fast. Thanks for the quick reply.

Author:  ghoulsblade [ Sat Oct 27, 2007 7:03 pm ]
Post subject: 

paletteing might be possible by using a pixel-shader with two textures, one 2d index texture, and a 1d palette texture. celshading/toonshading shaders work similarly.

you can use pixel-shaders in 2d-games if you use a hardware acceleration (e.g. opengl, directx, some graphics engine...)

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/