What is a good method for coloring textures based on a palette in XNA?
Posted
by
Bob
on Game Development
See other posts from Game Development
or by Bob
Published on 2010-07-15T01:04:40Z
Indexed on
2011/06/29
16:32 UTC
Read the original article
Hit count: 260
I've been trying to work on a game with the look of an 8-bit game using XNA, specifically using the NES as a guide.
The NES has a very specific palette and each sprite can use up to 4 colors from that palette. How could I emulate this? The current way I accomplish this is I have a texture with defined values which act as indexes to an array of colors I pass to the GPU. I imagine there must be a better way than this, but maybe this is the best way?
I don't want to simply make sure I draw every sprite with the right colors because I want to be able to dynamically alter the palette. I'd also prefer not to alter the texture directly using the CPU.
© Game Development or respective owner