$color: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
mNo edit summary
Line 2: Line 2:


  $color "[<red [[float]]> <green float> <blue float>]"
  $color "[<red [[float]]> <green float> <blue float>]"
$color "{<red [[integer]]> <green integer> <blue integer>}"


Quote marks are required. The default value is <code>[1 1 1]</code>.
Quote marks are required. A float value of 1.0 (or an integer value of 255) represents a unit scale; thus, the default value is <code>[1 1 1]</code> (or <code>{255 255 255}</code>).


== Solid color ==
== Solid color ==

Revision as of 20:17, 20 August 2009

$color independently scales the red, green and blue channels of an albedo.

$color "[<red float> <green float> <blue float>]"
$color "{<red integer> <green integer> <blue integer>}"

Quote marks are required. A float value of 1.0 (or an integer value of 255) represents a unit scale; thus, the default value is [1 1 1] (or {255 255 255}).

Solid color

This parameter can be used without an albedo to display a solid color without the need of a texture (except a %tooltexture). As well as a small saving in performance and memory footprint, material_modify_control can be used to completely change the material's color at run-time if desired.

In this scenario, [1 1 1] is pure white.

Tip.pngTip:If the material is representing empty blackness, you will probably want to use the UnlitGeneric shader to prevent it from ever becoming grey.