When i got to Linceworks, one of the tasks I took was to re-do all the skin customization system of the game. I took this task because the previous system consisted of one handpainted texture for each color, of each part, of each skin.
In total: 16 colors for each 4 parts of the 11 skins of the game, 704 1k textures for all of the skins, meaning that there was no mixing colors. We improved this to just 44 textures with the player being able to select 3 colors per part
The first problem was to maintain feature parity, the game had already launched when I started working in this system, so my shader had to be able to replicate the handpainted colors of the skins the players had already seen.
The system not only was up to what we allready had, but it also brought more detail from the original skin to the tinted ones, as you can seee in this image the new one (Right) has more detail in the cloth tahn the old one.
What I did was generate a RGB mask texture that defined the 3 colors that the player can choose, main, secondary for the skin, and extra for metals and details.
This way on the shader I can differentiate between them and tint those areas separately.
To get the detail of the base texture and not a solid color I use the original skin base color texture and desaturate it in the shader, this way I get a grayscale value of the detail and I can simply tint it with a tint color to get any skin, its just a matter of finding the correct color.
With this system we made an already existing feature teacher, the players went from having 16 colors for each skin to being able to choose between 16 main, secondary, and extra colors of each of the 4 parts of the skin, while also reducing the memory footprint, we went from 704 1k textures to just 44 while making them look ass good as handpainted.