Iris2.de

Iris2-Forum
It is currently Sat Oct 24, 2020 5:19 pm

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Palette Swapping
PostPosted: Sat Oct 27, 2007 4:28 pm 
Offline

Joined: Thu Oct 18, 2007 10:30 pm
Posts: 5
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.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 27, 2007 4:50 pm 
Offline
iris2-developer
User avatar

Joined: Tue Aug 22, 2006 1:21 pm
Posts: 173
Location: Munich, Germany
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).

_________________
O-->---


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 27, 2007 4:55 pm 
Offline

Joined: Thu Oct 18, 2007 10:30 pm
Posts: 5
Dang, that was fast. Thanks for the quick reply.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 27, 2007 7:03 pm 
Offline
iris2-developer
User avatar

Joined: Tue Apr 18, 2006 10:28 pm
Posts: 823
Location: Munich, Bavaria, Germany
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...)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group