How to modulate a single color from an image texture applied to a 3D model?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By awwyeaa

I’m making a 3D game and I’m going to use a single image texture containing a color palette for all the objects in my game.
I want to use a single color from that palette as sort of a “key color” that could be modulated, without affecting the other colors from the palette.
For example, I want to have a character with brown boots, blue pants and a shirt in that “key color” that can be modulated through code to any color I want it to be.
How can I achieve this?

Having a single texture for a mesh, and changing the colors in it, world be difficult. Usually, the materials for the mesh would be manipulated. Properties like “Albedo” would be accessed and changed separately at runtime would be much easier to implement.

Ertain | 2021-09-05 00:39

Yeah, doing it with different materials would be easier, but I really wanted to stick to a single texture if possible.

awwyeaa | 2021-09-05 14:13