Hi.I am developing a 2D strategy game like AoE 2.I need to change player color on sprites.How can i do that?
Jump to content
OpenGL API Specifications
Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.
Posted 19 May 2013 - 04:50 PM
Use 8-bit alpha maks which define the color changing regions. In the default version of the sprite, color the changing areas as white. In the pixel shader, modulate the sprite texel with the desired unit color and then lerp between the original sprite color and the modulated sprite color according to the alpha map.
GameDev.net™, the GameDev.net logo, and GDNet™ are trademarks of GameDev.net, LLC.