How to shade a texture two different colors?

Posted by Venesectrix on Game Development See other posts from Game Development or by Venesectrix
Published on 2012-12-08T01:29:54Z Indexed on 2012/12/08 6:00 UTC
Read the original article Hit count: 267

Filed under:
|

To give an example of what I'm asking about, I'll use Saints Row 3 since I've been playing that lately. In that game you can customize your looks and your car's appearance a lot. Your coat can have a primary color and a trim color. Your car can have a primary color and a stripe color, etc.

Is there just a single coat texture that is being shaded two different colors somehow or are they overlaying a transparent second texture for the trim/stripes that gets shaded differently?

If it's just one texture I'd like to know how it's done.

If it's two different textures it seems like it's a waste of space. The second texture would be the same size as the first one but mostly transparent if you just wanted to lay it on top of the first one. Or are they just carefully positioning a second, smaller texture so that it aligns properly with the first one?

© Game Development or respective owner

Related posts about textures

Related posts about shaders