-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Alright, so this will take probably a full day of work from somebody who is more good at photoshop than I am. First, grab the sample here:
Extract this to your local data "quetoo\default\players\guard" (not your data dir, the read-only one) and load the skin in-game, using "cg_third_person 1" to see yourself. (at the time of writing the player model menu does not support the tinting yet - we're waiting to add the HSV sliders for that)
Basically, I added a new system in the game that I'm calling a "tintmap" - this allows for player models (or, well, any model, but only client models use the tints currently) to be tinted by three separate colors that are defined and set up by the engine. The concept is similar to what games like Sim City use to randomly color buildings and stuff.
The problem is that this will require some work to convert our models to use the tintmaps. The concept is simple - you're converting this:
into these:
The texture, similar to normal/gloss maps, is simply plopped next to the main texture and has "_tint" appended to it. The game will automatically pick up on this. No extra work is required to get this functionality to work.
Each color channel in the tintmap represents a specific tint color; the red channel is the % of tint color 1 to use, the green channel is the % of tint color 2, and the blue channel is the % of tint color 3. The alpha channel is ignored in the color calculation, but pixels with alpha 0 are not checked for tint values. The color components must be premultiplied by the alpha! That is to say, a value of 255,0,0,0 will not work properly because of the way filtering works. All color components must be pre-multiplied by their alpha value (all empty pixels should be all zero; if you use alpha anywhere in the color masks, multiply that color component by its alpha as well).
Currently, the game uses tint color 1 for "shirt", tint color 2 for "pants" and tint color 3 for "head". I've not used tint color 3 in my sample, but it should work. Only the player model makes use of this system at the moment.
The second part to this is that you can also define what colors are used if shirt/pants/head are set to "default" via a material file. As an example, the guard above had an "upper.mat" like such:
{
material #players/guard/default
tintmap.shirt_default 1.0 0.38 0.125
tintmap.pants_default 0.6 0.38 0.17
}
In this case, with those textures above, if you don't explicitly specify a shirt/pants color, you will get one that looks very close to what the old default texture had.
To assign these to tints in-game, use the userinfo cvars "shirt" and "pants" - these can be HTML hexadecimal color values ("rgb" or "rrggbb" format), or "default", which pulls the color from the material file or uses white as a fallback.
I think that covers the complete usage of this feature and hopefully Pan or whomever can take charge in editing our player models to work with this system.


