{"action":"created","issue":{"url":"https://api.github.com/repos/jdolan/quetoo-data/issues/91","repository_url":"https://api.github.com/repos/jdolan/quetoo-data","labels_url":"https://api.github.com/repos/jdolan/quetoo-data/issues/91/labels{/name}","comments_url":"https://api.github.com/repos/jdolan/quetoo-data/issues/91/comments","events_url":"https://api.github.com/repos/jdolan/quetoo-data/issues/91/events","html_url":"https://github.com/jdolan/quetoo-data/issues/91","id":208396945,"number":91,"title":"Pants/shirt/head color masks for our default skins","user":{"login":"Paril","id":1224734,"avatar_url":"https://avatars.githubusercontent.com/u/1224734?v=3","gravatar_id":"","url":"https://api.github.com/users/Paril","html_url":"https://github.com/Paril","followers_url":"https://api.github.com/users/Paril/followers","following_url":"https://api.github.com/users/Paril/following{/other_user}","gists_url":"https://api.github.com/users/Paril/gists{/gist_id}","starred_url":"https://api.github.com/users/Paril/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Paril/subscriptions","organizations_url":"https://api.github.com/users/Paril/orgs","repos_url":"https://api.github.com/users/Paril/repos","events_url":"https://api.github.com/users/Paril/events{/privacy}","received_events_url":"https://api.github.com/users/Paril/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/jdolan/quetoo-data/milestones/1","html_url":"https://github.com/jdolan/quetoo-data/milestone/1","labels_url":"https://api.github.com/repos/jdolan/quetoo-data/milestones/1/labels","id":370141,"number":1,"title":"1.0 release","description":"","creator":{"login":"jdolan","id":643118,"avatar_url":"https://avatars.githubusercontent.com/u/643118?v=3","gravatar_id":"","url":"https://api.github.com/users/jdolan","html_url":"https://github.com/jdolan","followers_url":"https://api.github.com/users/jdolan/followers","following_url":"https://api.github.com/users/jdolan/following{/other_user}","gists_url":"https://api.github.com/users/jdolan/gists{/gist_id}","starred_url":"https://api.github.com/users/jdolan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdolan/subscriptions","organizations_url":"https://api.github.com/users/jdolan/orgs","repos_url":"https://api.github.com/users/jdolan/repos","events_url":"https://api.github.com/users/jdolan/events{/privacy}","received_events_url":"https://api.github.com/users/jdolan/received_events","type":"User","site_admin":false},"open_issues":8,"closed_issues":36,"state":"open","created_at":"2013-07-03T23:38:50Z","updated_at":"2017-02-17T10:19:27Z","due_on":"2017-03-01T08:00:00Z","closed_at":null},"comments":4,"created_at":"2017-02-17T10:19:27Z","updated_at":"2017-02-22T10:15:30Z","closed_at":null,"body":"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:\r\n\r\n[guard.zip](https://github.com/jdolan/quetoo-data/files/782914/guard.zip)\r\n\r\nExtract 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)\r\n\r\nBasically, 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.\r\n\r\nThe problem is that this will require some work to convert our models to use the tintmaps. The *concept* is simple - you're converting this:\r\n\r\n![](http://i.imgur.com/qrXBPv8.png)\r\n\r\ninto these:\r\n\r\n![](http://i.imgur.com/l9rwgWs.png) -> ![](http://i.imgur.com/umCA4UE.png)\r\n\r\nThe 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.\r\n\r\nEach 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).\r\n\r\nCurrently, 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.\r\n\r\nThe 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:\r\n\r\n```\r\n{\r\n\tmaterial #players/guard/default\r\n\ttintmap.shirt_default 1.0 0.38 0.125\r\n\ttintmap.pants_default 0.6 0.38 0.17\r\n}\r\n```\r\n\r\nIn 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.\r\n\r\nTo 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. \r\n\r\nI 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."},"comment":{"url":"https://api.github.com/repos/jdolan/quetoo-data/issues/comments/281626880","html_url":"https://github.com/jdolan/quetoo-data/issues/91#issuecomment-281626880","issue_url":"https://api.github.com/repos/jdolan/quetoo-data/issues/91","id":281626880,"user":{"login":"Paril","id":1224734,"avatar_url":"https://avatars.githubusercontent.com/u/1224734?v=3","gravatar_id":"","url":"https://api.github.com/users/Paril","html_url":"https://github.com/Paril","followers_url":"https://api.github.com/users/Paril/followers","following_url":"https://api.github.com/users/Paril/following{/other_user}","gists_url":"https://api.github.com/users/Paril/gists{/gist_id}","starred_url":"https://api.github.com/users/Paril/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Paril/subscriptions","organizations_url":"https://api.github.com/users/Paril/orgs","repos_url":"https://api.github.com/users/Paril/repos","events_url":"https://api.github.com/users/Paril/events{/privacy}","received_events_url":"https://api.github.com/users/Paril/received_events","type":"User","site_admin":false},"created_at":"2017-02-22T10:15:30Z","updated_at":"2017-02-22T10:15:30Z","body":"@kaadmy Lovely job on the Qforcer default and Guard default.tga!\r\nI have a few things that I need you to do before we can button this one up, though.\r\n\r\n- [ ] Before doing the below, fix up the code to resolve issues Jay had with the setup; he didn't want the game to use SHIRT/PANTS/HEAD in the constants or material parsing. Maybe we should just change those to TINT_R, TINT_G and TINT_B or something, to keep it generic.\r\n- [ ] Guard has Shotgun Guard and Machinegun Guard skins in there (they were sgss and mgss) that could be tinted as well.\r\n- [ ] Make sure that the shirt_default/pants_default colors are set up to look as close as possible to the skin as it was in pre-tint state.\r\n- [ ] Guard had a special CTF skin (red.skin/blue.skin) that you need to tint. Call this skin \"ctf\" - that's what the game will load for teamplay games. Don't worry about any of the other color skins, that's the only one I'm worried about.\r\n- [ ] Don't put the #default material in both upper.mat and lower.mat - this creates two entries in the material table and won't work properly. Just use one .mat file for everything (upper.mat is probably the best option). head.mat can stay where it is since it has special stuff for the visor.\r\n- [ ] Gork will be fairly simple, but Bunker and Dragoon also have a CTF skin that you should have in a ctf.skin/.tga/_tint.tga setup.\r\n- [ ] Supporting tints on other models is fairly easy - you just need to set up the \"tints\" pointers to whatever color value you want to tint it with. You could make a generic \"EF_TEAM_TINT\" effect, which reads team index from s.client or s.animation1, and pulls the color from the global teams table (the team colors are passed in a configstring called CS_TEAM_INFO). To make things simple, -don't- calculate tints themselves every frame, just pass a pointer to a tint that is already calculated (CS_TEAM_INFO parsing, if it's not done already, you can store tint info in there - see Cg_LoadClient for how I calculate tints for shirt/pants vars)\r\n- [ ] Add \"helmet\" tint serverinfo cvar & parsing for said cvar.\r\n\r\nI think that's all that needs to be done to call this done 4 good"}}
{"actor":{"display_login":"Paril"}}