Difference between revisions of "Talk:$color"

From Valve Developer Community
Jump to: navigation, search
m (Solid Color)
Line 31: Line 31:
  
 
::Also I've noticed that the LightmappedGeneric VMT with just $color often displays as a purple-and-black texture in Hammer for a minute... then magically assumes the color. But in game the LightmappedGeneric version works fine always.--[[User:Shawnolson|Shawnolson]] 07:24, 18 September 2011 (PDT)
 
::Also I've noticed that the LightmappedGeneric VMT with just $color often displays as a purple-and-black texture in Hammer for a minute... then magically assumes the color. But in game the LightmappedGeneric version works fine always.--[[User:Shawnolson|Shawnolson]] 07:24, 18 September 2011 (PDT)
 +
:::The quotes around the values are required because otherwise it would cut off the string at the first space. I also noticed that you are mixing integers and floats there, that can't be good. I've personally never used the {int int int} syntax for anything yet, maybe you have more luck using [float float float]?
 +
:::It's rather likely that this behaves differently between shaders, after all the way this feature is implement is not globally defined somehow, so it could be working fine in one situation while it's broken in another. --[[User:Biohazard 90|Biohazard]] 08:51, 18 September 2011 (PDT)

Revision as of 15:51, 18 September 2011

Does $color apply to the whole material, or just the RGB of the $basetexture ?

Solid Color

The docs state:

This parameter can be used without an albedo to display a solid color without the need of a texture

But when I use a VMT like this:

"VertexLitGeneric"
{

	 "$color" "{165.0 150.0 218.0}"
}

The material is always just white. Is this limited to a certain shader?

The material is loading on the model... but it is simply white. Is there some special step for this?

Brain fart... tried without the quotation marks around the $color and it's working. [EDIT]... not really true... see below. --Shawnolson 15:00, 17 September 2011 (PDT)

What, around the value? --Artfunkel 03:06, 18 September 2011 (PDT)
No... actually around the $color like "$color" ... but I'm not certain that has anything to do with it now... probably because I am not clear on some docs regarding this. Without quotes around the value it won't work at all... but for some reason it seems to only show purple and black with the $color in quotes (though I'm certain I've done that before with parameters with no problems). I may have assumed the quotes had an issue because of the following inconsistencies during testing and I didn't take notes on specifically what I was doing originally.
What I'm now noticing is that it's working on LightmappedGeneric but not VertexLitGeneric. For VertexLitGeneric it seems to always be white with the example above (in Hammer and in game). But when I use it on LightmappedGeneric it will work.
Also I've noticed that the LightmappedGeneric VMT with just $color often displays as a purple-and-black texture in Hammer for a minute... then magically assumes the color. But in game the LightmappedGeneric version works fine always.--Shawnolson 07:24, 18 September 2011 (PDT)
The quotes around the values are required because otherwise it would cut off the string at the first space. I also noticed that you are mixing integers and floats there, that can't be good. I've personally never used the {int int int} syntax for anything yet, maybe you have more luck using [float float float]?
It's rather likely that this behaves differently between shaders, after all the way this feature is implement is not globally defined somehow, so it could be working fine in one situation while it's broken in another. --Biohazard 08:51, 18 September 2011 (PDT)