I'm making kind of a classic 2d rts game like starcraft, aoe1. cossack...
For team color (1->8). AOE1 use pallete color I think, they only use 256 pallete bmp color!
I know many ppl asked about this.
After 2 days searching I found only 1 way, is using Pixel Shader and look up table. Pallete no more usable in today cards and direcx9.
But does Pixel Shader support quite old Computer that do not have hardware graphic card. I want my game to support as much ppl as it can. Because this is just a 2D game. One more problem is that with Pixel shader, you have to set Beginpass, before each sprite batch. If i draw team 1 player unit, then team 2 player unit, then team 1... -> many beginpass will have to draw, and it will kill the performance !
I tried to generate texture for each team color. But it seem too bad. with only 1 team, the game used 300-400mb texture, ( 1 sprite for attack may use a texture of 3000x200 image size, 1 unit used about 5 sprite, and the game have many units ). for 8 player, it will kill any high end comp. That's absurd.
Using maskColor in gSprite->draw ( Then use a color sprite of gray color to draw over the real sprite ). Can help me a lot, but it's quite limited. Make the color look weird. This is the method I'm using in the game now.
I'm running out of ideas. Can you give me a better Idea. I think this is a very simple thing, and games decades ago can solve it very well. I wish I can touch the genie engine or dmcr
I'm thinking of 2 direction :
Use pixel shader : but make sure it call less BeginPass ass possible, Because my units are draw in order of relative depth. Cant draw blue units, then red units, then...
Generated Units color, so must optimize the texture resource management...