Archived

This topic is now archived and is closed to further replies.

Player colors in a texture

This topic is 5308 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Lets say I have a 3D model that is common to each player in my game. The only difference is that parts of the model are the player''s color: Red, Green, Blue, or Orange. I could create four textures, each with one of the above mentioned colors but that seems wasteful. Seems like there should be an easy way to re-use one texture but tell D3D to render certain pixels using the current player''s colors. I tried using a material but that influences the entire model, not just the parts that should be changed. Can anyone point me in the right direction? I suspect it will be one of the render states that deals with color or alpha blending but I''m still a bit new to this. Thanks in advance, LEJ

Share this post


Link to post
Share on other sites
Separate your meshes in 2 subsets each so you can use 2 diferent materials on a single mesh.

I hope it helps you.


KaM1KaZ3

Share this post


Link to post
Share on other sites
Hmmm, that''s good to know for a future project but I should have mentioned one item that will probably make a difference.

The object in question is a playing card. The cards are exactly the same except for a semi-circle in the upper left and lower right corners. So, I''m not actually using a mesh. It''s such a simple object that I''m just using a 2-sided quad. In reality I could make four textures containing all the cards for each of the four colors and it wouldn''t take too much memory. But I wanted to know the most efficient way for my own education.

Any other approaches anyone would like to offer would be appreciated as well, the more I learn the better.

Thanks,
LEJ

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
You could put the circle in the alpha of the texture, then blend with a small texture, or the material color (assuming you aren''t doing lighting), or TFACTOR (assuming you aren''t targetting RagePro type cards).

Share this post


Link to post
Share on other sites