Facepunch / garrysmod-requests

Feature requests for Garry's Mod
84 stars 24 forks source link

Support for Colormaps/Colorcode/whatver the technical term is. #288

Open Vipes opened 10 years ago

Vipes commented 10 years ago

Not sure if this is possible, but do you think Gmod could ever get support for a colormap/colorcode, whatever it's called? A lot of new games are using them, and it'd help with porting from them. For example Red channel could be Primary Color, Green Channel could be Secondary Color, Blue Channel could be Tertiary color, while black would leave the texture alone.

Code example: "$baseTexture" "models\player\path\texture" "$bumpmap" "models\player\path\texture_bump" "$ccmap" "models\player\path\texture_cc

Image example: This is the base texture. mp_intruder

This is the colormap. This one however only takes advantage of Red and Green. mp_intruder_cc

A person ingame sets their Primary Color to Tan, and Secondary to Yellow, and this is how the texture will appear ingame. mp_intruder_colored

Uses: -Frees up the Alpha in the Base Texture for anything you want to put in/need -Colormaps are much easier to make -Supports up to three playercolors instead of the standard one

FirstRoboticsGuy999 commented 10 years ago

Couldn't you just make material proxies anyway? Besides, the only thing diffuse alpha can really be used for is opacity; because specular must be put into the the alpha channel of the normal map to work.

Adding this would probably require access to the material system's code, which is not included in the SDK for obvious reasons. If you wanted you could use $blendtintbybasealpha, which will tint the color based on the alpha map in the diffuse

http://www.polycount.com/forum/archive/index.php/t-93374.html

Vipes commented 10 years ago

Alpha maps only support White, Black, and shades of Grey however, so that really solves nothing related to this.

robotboy655 commented 10 years ago

Well, it may be a good idea, but: 1) It may take quite a lot of time to implement 2) It will prevent the materials from being usable in other source engine games since they do not support this.

Vipes commented 10 years ago

I'm ok with number 1, as for the second one, people could always make another version like the old way.

UnderscoreKilburn commented 10 years ago

2) isn't a problem, since when has anyone used a model made for GMod in another Source game? That said, it basically requires a new variant of VertexLitGeneric, and with how weird Valve's shader system is, it might take a while. I hope you don't mind if I consider this a low priority request.

robotboy655 commented 10 years ago

I was mainly talking about SFM, but not that it matters really.

Vipes commented 10 years ago

Not at all Kilburn, me, and a good amount of others would love to see it in, doesn't matter how long it'd take. Thanks man. I'd be great to finally have playermodels that can have more than one playercolor. Thanks again.

Vipes commented 10 years ago

I just remembered CS:GO uses something like this for weapons. May it be possible to look into it?

gonzalologorg commented 10 years ago

Actually this was implemented on l4d, that's how all the infected got different cloth color

Vipes commented 10 years ago

You learn something new everyday. Neat.