Page 1 of 1

We don´t have $blendtintbybasealpha here

Posted: Thu Apr 25, 2013 1:42 pm
by MaestraFénix
As I asked on the following posts about this:

http://obsidianconflict.net/forums/view ... 669#p74669

http://obsidianconflict.net/forums/view ... 675#p74675

We didn´t knew at 100% if this was possible. Of course, if you use FX Color without any parameter, you will colour the model...without seeing the texture.

But Left 4 Dead bring to us a new parameter:

$blendtintbybasealpha 1

With this VMT parameter, now it allows you to colour a model with only one texture file (goodbye multiple color skins/models).


How to use it?

The first of all, you need your base texture. Let´s gonna imagine that is a car, and, inside of it, is everything (wheels, lights, doors...) except the glass, that goes on a separate model (I´ll later explain about this). You want colour your car as you want, but, without making the tires and everything that you don´t want at the same colour (leave it original).

You need to make an alpha channel on the texture, so, the parts that you NOT want to be coloured must be transparent, so, the final result after opening the texture file on VTFEdit is seeing the colourable part with the view->mask enabled.

Then, on your VMT, aside of the other parameters that you probably you will need, use "$blendtintbybasealpha" "1".


Save, and open Hammer. Your model only can be a prop_dynamic or prop_physics (p_p_multiplayer works too). Let´s gonna pick prop_physics for our car. After chose the model, on propierties, go to the FX color option and pick the colour that you want. The result aren´t seen in Hammer, only in game, so save and compile.

And ta-da. there is, your car, with the hability of being paintable, using only one texture.


Now, imagine combining that with bodygroups, normal maps and more.... :twisted:



BUT WE DON´T HAVE IT HERE ON OBSIDIAN CONFLICT.



Advantages:
  • You only use a texture base for your model, so you don´t need multiple skins for your model, saving on texture memory.
  • There aren´t limits on the colour that you want (RGB).
Disadvantages:
  • Since the FX colors and amount options only comes with an entity, it means that you only can edit one part of your model (so, you would to have to do separate entities in order to colour more stuff, that´s why the glass of the cars in L4D are a separete model).
  • If you don´t edit your alpha map, it will apply the color to all the texture (you maybe want some stuff always on their color, like black on the tires). And not only that texture, but all the textures of the model.
  • (Looks like that)The color can´t be edited in-game.(maybe with the material_modify_control entity, but I didn´t tried yet).
*Deleted example for being wrong*

Re: Colour models in Hammer on OC: Is possible

Posted: Fri Jun 14, 2013 11:25 am
by RocketRunner
So, this is basically "how to color most or all of a model in Hammer without needing all-new texture files"?

Also, those APCs remind me of Command & Conquer, for some reason.

Re: Colour models in Hammer on OC: Is possible

Posted: Fri Jun 14, 2013 4:03 pm
by MaestraFénix
RocketRunner wrote:So, this is basically "how to color most or all of a model in Hammer without needing all-new texture files"?

Also, those APCs remind me of Command & Conquer, for some reason.
Yes. You can drive that APC on my Siege map. Search a server with the last version, that is V3.

Re: Colour models in Hammer on OC: Is possible

Posted: Wed Jun 19, 2013 6:36 pm
by MaestraFénix
I continued doing tests, and I was wrong: The parameter $blendtintbybasealpha 1 is not available for OC. It looks like it currently works on TF2, L4D/L4D2, Alien Swarm, and the newer games.


And of course I can´t request it on the bugtracker to add it since we don´t have access to newer code.


*There goes the texture saves on different colors*

Re: We don´t have $blendtintbybasealpha here

Posted: Wed Jun 19, 2013 6:58 pm
by TESLA-X4
New shaders would be needed to support that parameter.

Re: We don´t have $blendtintbybasealpha here

Posted: Thu Jun 20, 2013 4:57 am
by Gary
Oh boy, compiling shaders, there is nothing more enjoyable.