Material vector: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Created page with 'A '''material vector''' is a collection of values used with some material commands. They most often represent an RGB color. == Syntax == $scale "[1 1]" $color…')
 
mNo edit summary
 
(6 intermediate revisions by 5 users not shown)
Line 1: Line 1:
A '''material vector''' is a collection of values used with some [[material]] commands. They most often represent an [[RGB]] color.
{{languageBar}}
 
A '''material vector''' is a collection of values used with some [[material]] commands. They most often represent a [[RGB]] color.
__NOTOC__
== Syntax ==
== Syntax ==


Line 7: Line 8:
  $color "{255 255 255}"
  $color "{255 255 255}"
  [[$envmaptint]] "{100 0 58}"
  [[$envmaptint]] "{100 0 58}"
$vec4 "[1 2 3 4]"


* Quotes are always required, because there are spaces in the value
* Quotes are always required, because there are spaces in the value.
* Values inside <nowiki>[square brackets]</nowiki> are [[normal]]s
* Values inside <code>[</code>square brackets<code>]</code> are used as-is, often for [[float]]s or [[normal]]s. They are [[normal]]s for colors.
* Values inside {curly brackets} are absolute (the range for colors is 0-255)
* Values inside <code>{</code>curly brackets<code>}</code> are divided by 255, so that standard RGB integer 0-255 values can be used.
 
* Between two to four values can be used, depending on the requirements of the parameter. Listed below:
{{todo|Is there a limit on the number of components?}}
====vector2====
: A vector with two values.
====vector3====
: A vector with three values.
====vector4====
: A vector with four values.


== Accessing ==
== Accessing ==
Access an individual component of a material vector like this:
Access an individual component of a material vector like this:


Line 21: Line 27:
  $my_vector[1]
  $my_vector[1]
  // etc.
  // etc.
 
[[Category:Glossary]][[Category:Material System]]
[[Category:Material System]]

Latest revision as of 11:30, 14 August 2024

English (en)Hrvatski (hr)Русский (ru)Translate (Translate)

A material vector is a collection of values used with some material commands. They most often represent a RGB color.

Syntax

$scale "[1 1]"
$color "[1 1 1]"
$color "{255 255 255}"
$envmaptint "{100 0 58}"
$vec4 "[1 2 3 4]"
  • Quotes are always required, because there are spaces in the value.
  • Values inside [square brackets] are used as-is, often for floats or normals. They are normals for colors.
  • Values inside {curly brackets} are divided by 255, so that standard RGB integer 0-255 values can be used.
  • Between two to four values can be used, depending on the requirements of the parameter. Listed below:

vector2

A vector with two values.

vector3

A vector with three values.

vector4

A vector with four values.

Accessing

Access an individual component of a material vector like this:

$my_vector[0]
$my_vector[1]
// etc.