We don´t have $blendtintbybasealpha here

Discuss Certain Aspects of Mapping, Modeling, and Coding.
Post Reply
MaestraFénix
Team Member
Team Member
Posts: 2470
Joined: Mon May 10, 2010 11:50 am
Location: Spain
Contact:

We don´t have $blendtintbybasealpha here

Post 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*
Last edited by MaestraFénix on Wed Jun 19, 2013 6:38 pm, edited 1 time in total.
Click on my photo to add me into your friends in Steam
Image
Steam photos | Steam videos

Image
User avatar
RocketRunner
npc_combine_elite
npc_combine_elite
Posts: 467
Joined: Thu Apr 23, 2009 5:19 am
Location: Phoenix, AZ

Re: Colour models in Hammer on OC: Is possible

Post 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.
I usually run from rockets.
Pretty straightforward.
MaestraFénix
Team Member
Team Member
Posts: 2470
Joined: Mon May 10, 2010 11:50 am
Location: Spain
Contact:

Re: Colour models in Hammer on OC: Is possible

Post 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.
Click on my photo to add me into your friends in Steam
Image
Steam photos | Steam videos

Image
MaestraFénix
Team Member
Team Member
Posts: 2470
Joined: Mon May 10, 2010 11:50 am
Location: Spain
Contact:

Re: Colour models in Hammer on OC: Is possible

Post 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*
Click on my photo to add me into your friends in Steam
Image
Steam photos | Steam videos

Image
User avatar
TESLA-X4
Former Developer
Former Developer
Posts: 570
Joined: Wed Jul 01, 2009 3:26 pm
Location: $Recycle.Bin

Re: We don´t have $blendtintbybasealpha here

Post by TESLA-X4 »

New shaders would be needed to support that parameter.
Apparently, Valve can't make games beyond the number 2.
I think the only time we'll get a Source SDK code update is when it starts having purchasable hats integrated, i.e. hatconomy.

Please do not make assumptions you are not knowledgeable enough to make - that just backfires on yourself.
Tick me off, and I'll be sure to give you the golden treatment. Haven't you heard? Silence is golden.
Gary
npc_advisor
npc_advisor
Posts: 1125
Joined: Sun Nov 09, 2008 7:21 am
Location: USA, FL
Contact:

Re: We don´t have $blendtintbybasealpha here

Post by Gary »

Oh boy, compiling shaders, there is nothing more enjoyable.
Post Reply