List of material proxies: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(probably better, use <wbr> to make long material name able to line break)
 
(151 intermediate revisions by 50 users not shown)
Line 1: Line 1:
{{LanguageBar}}
{{Main|Material proxies}}
All material proxies usable in [[Material|materials]] at all {{src13}} games can be found here, along with proxies only present in specific games. (Mostly other Valve titles)<br>
{{todo|There are still lots of undocumented proxies / proxies lacking enough documentation! <!-- such as? -->}}
{{important|Unlike material variables, material proxy names are case sensitive.}}
== Calculation ==
== Calculation ==
{{note|Operations involving integers of all these proxies will be converted to a float result value, except for <code>Equals</code> and <code>Clamp</code>.}}
<div style="display:grid; grid-template-columns:repeat(auto-fit, minmax(24em, auto));">
{{MatProxyCell|title=Add|desc=Adds two variables.|arguments=
; <code>srcVar1</code>
; <code>srcVar2</code>
; <code>resultVar</code>
: Returns <code>srcVar1 + srcVar2</code>.
}}
{{MatProxyCell|title=Multiply|desc=Multiplies two variables.|arguments=
; <code>srcVar1</code>
; <code>srcVar2</code>
; <code>resultVar</code>
: Returns <code>srcVar1 * srcVar2</code>.
}}
{{MatProxyCell|title=Subtract|desc=Subtracts the second variable from the first.|arguments=
; <code>srcVar1</code>
; <code>srcVar2</code>
; <code>resultVar</code>
: Returns <code>srcVar1 - srcVar2</code>.
}}
{{MatProxyCell|title=Divide|desc=Divides the first variable by the second.|arguments=
; <code>srcVar1</code>
; <code>srcVar2</code>
; <code>resultVar</code>
: Returns <code>srcVar1 / srcVar2</code>.
}}
{{MatProxyCell|title=Equals|desc=Copies the value of a variable to another.|arguments=
; <code>srcVar1</code>
; <code>resultVar</code>
: Returns <code>srcVar1</code>.
}}
{{MatProxyCell|title=Abs|desc=Computes the absolute (i.e. [[unsigned]]) value of a variable.|arguments=
; <code>srcVar1</code>
; <code>resultVar</code>
: Returns <code>abs(srcVar1)</code>.
}}
{{MatProxyCell|title=Frac|desc=Returns the fractional component of a variable. For integer values, no change occurs. {{tip|frac(4.23) {{=}} .23}}|arguments=
; <code>srcVar1</code>
; <code>resultVar</code>
}}
{{MatProxyCell|title=Int|desc=Returns the integer component of a variable.'' {{tip|int(4.23) {{=}} 4}}|arguments=
; <code>srcVar1</code>
; <code>resultVar</code>
}}
{{MatProxyCell|title=Clamp|desc=Keeps a variable within a specified range. <code>srcVar1</code> and <code>resultVar</code> can be the same.|arguments=
; <code>min</code>
; <code>max</code>
; <code>srcVar1</code>
; <code>resultVar</code>
: Returns the value in the range <code>[min, max]</code> that is the closest to <code>srcVar1</code>.
}}
{{MatProxyCell|title=LessOrEqual|desc=Compares the first value to the second.|arguments=
; <code>lessEqualVar</code>
; <code>greaterVar</code>
; <code>srcVar1</code>
; <code>srcVar2</code>
; <code>resultVar</code>
: If <code>srcVar1 &le; srcVar2</code>, returns <code>lessEqualVar</code>, otherwise <code>greaterVar</code>.
}}
{{MatProxyCell|title=SelectFirstIfNonZero|desc=Selects the first value over the second if it is anything other than zero.|arguments=
; <code>srcVar1</code>
; <code>srcVar2</code>
; <code>resultVar</code>
: If <code>srcVar1 {{=}}{{=}} 0</code>, returns <code>srcVar1</code>, otherwise <code>srcVar2</code>.
}}
{{MatProxyCell|title=WrapMinMax|desc=Constrains a value into a range, wrapping around if it exceeds it.|arguments=
; <code>srcVar1</code>
: The value to constrain.
; <code>minVal</code>
; <code>maxVal</code>
: Range to constrain the value to. If min is less than max, min is always returned.
; <code>resultVar</code>
: The variable to write the results to.
}}
{{MatProxyCell|title=Exponential|desc=A value that [[Wikipedia:Exponential function|changes at a faster and faster rate]].|arguments=
; <code>minVal</code>
; <code>maxVal</code>
: Upper and lower value clamps.
; <code>srcVar1</code>
; <code>offset</code>
; <code>scale</code>
; <code>resultVar</code>
: Returns <code>scale * exp( srcVar1 + offset )</code> {{tip|1=exp(n) = e<sup>n</sup>}}
}}
</div>


<div style="-moz-column-count:2;-webkit-column-count:2;column-count:2;">
== Number generation ==
; <code>Add</code>
<div style="display:grid; grid-template-columns:repeat(auto-fit, minmax(24em, auto));">
: ''Adds two variables.''
{{MatProxyCell|title=Sine|desc=A [[w:sine wave|sine wave]].|arguments=
:; <code>srcVar1</code>
; <code>sineperiod</code>
:; <code>srcVar2</code>
: Period between wave peaks, in seconds.
:; <code>resultVar</code>
; <code>sinemin</code>
; <code>Multiply</code>
; <code>sinemax</code>
: ''Multiplies two variables.''
: Values at the top and bottom of the wave
:; <code>srcVar1</code>
; <code>timeoffset</code>
:; <code>srcVar2</code>
: Used to offset the starting position of the wave
:; <code>resultVar</code>
; <code>resultVar</code>
; <code>Subtract</code>
: Returns <code>sinemin + (sinemax-sinemin)/2 * (1 + sin( 2*pi/sineperiod * (time + timeoffset) ))</code>.
: ''Subtracts the second variable from the first.''
}}
:; <code>srcVar1</code>
{{MatProxyCell|title=LinearRamp|desc=An ever-increasing [[float]] value.|arguments=
:; <code>srcVar2</code>
; <code>rate</code>
:; <code>resultVar</code>
: Units per second.
; <code>Divide</code>
; <code>initialValue</code>
: ''Divides the first variable by the second.''
: Value at map start.
:; <code>srcVar1</code>
; <code>resultVar</code>
:; <code>srcVar2</code>
: Returns <code>rate * time + initialValue</code>.
:; <code>resultVar</code>
{{note|The value is ''not'' continuous as one might expect, i.e. if the rate is changed dynamically, it will not 'add' to the previous value. }}
; <code>Equals</code>
}}
: ''Copies the value of a variable to another.''
{{MatProxyCell|title=CurrentTime|desc=The number of seconds the current map has been running on the server for.|arguments=
:; <code>srcVar1</code>
; <code>resultVar</code>
:; <code>resultVar</code>
: This is intended to set the <code>$time</code> shader variable, used by several shaders to adjust their effects over time.
; <code>Abs</code>
}}
: ''Computes the absolute (i.e. [[unsigned]]) value of a variable.''
 
:; <code>srcVar1</code>
{{MatProxyCell|title=UniformNoise|desc=A noisy signal where each value is equally likely to occur.|arguments=
:; <code>resultVar</code>
; <code>minVal</code>
; <code>Frac</code>
; <code>maxVal</code>
: ''Returns the fractional component of a variable.'' {{tip|frac(4.23) <nowiki>=</nowiki> .23}}
; <code>resultVar</code>
:; <code>srcVar1</code>
: Returns an random value in the range <code>[minVal, maxVal]</code> with equal probability.
:; <code>resultVar</code>
}}
; <code>Clamp</code>
{{MatProxyCell|title=GaussianNoise|desc=A noisy signal where values are biased towards the average.|arguments=
: ''Keeps a variable within a specified range.''
; <code>mean</code>
:; <code>min</code>
: The average value around which the noise will centre
:; <code>max</code>
; <code>halfWidth</code>
:; <code>srcVar1</code>
: The distance from the average at which it's only 30% likely to occur.
:; <code>resultVar</code>
; <code>minVal</code>
:: srcVar1 and resultVar can be the same.
; <code>maxVal</code>
; <code>LessOrEqual</code>
; <code>resultVar</code>
: ''Compares the first value to the second.''
}}
:; <code>lessEqualVar</code>
{{MatProxyCell|title=MatrixRotate|desc=A [[rotation matrix]] from the provided axis and angle.|arguments=
:; <code>greaterVar</code>
; <code>axisVar</code>
:: Variable to copy to <code>resultVar</code> if this condition is met.
: Axis of rotation, in the format <code>[x y z]</code>
:; <code>srcVar1</code>
; <code>angle</code>
:; <code>srcVar2</code>
: Degrees of rotation around axis.
:; <code>resultVar</code>
; <code>resultVar</code>
: The result of this is a transformation matrix, suitable to set <code>$basetexturetransform</code> and other similar variables.
}}
</div>
</div>


== Number generation ==
== Entity Data Access ==
These proxies read values from the entity the proxy is applied to.
{{warning|Will cause a crash when used on [[prop_static]], [[world brush]]es, [[infodecal]], [[info_projecteddecal]], or unnamed [[info_overlay]]s. Named [[info_overlay]]s are fine.}}
 
<div style="display:grid; grid-template-columns:repeat(auto-fit, minmax(24em, auto));">
{{MatProxyCell|title=Alpha|desc=Copies the entity's {{code|renderamt}} value to the <code>$alpha</code> material parameter.|arguments=
; <code>$alpha</code>
: The alpha material variable is set to the value of the entity's {{code|renderamt}}
}}
{{MatProxyCell|title=Cycle|desc=Outputs the progress through the current animation of the entity.|arguments=
; <code>start</code>
: The value to output at the start of the animation. This can't be a variable reference.
; <code>end</code>
: The value to output at the end of the animation. This can't be a variable reference.
; <code>easein</code>
: Apply easing to the beginning of the output. This can't be a variable reference.
; <code>easeout</code>
: Apply easing to the beginning of the output. This can't be a variable reference.
; <code>resultVar</code>
: The variable to store the result in.
}}
{{MatProxyCell|title=PlayerProximity|desc=Outputs the distance in units between the local player and the origin of the entity that the material is applied to.|arguments=
; <code>scale</code>
: A factor by which the result is multiplied.
; <code>resultVar</code>
}}
{{MatProxyCell|title=PlayerTeamMatch|desc=Returns 1 if the team of the entity the material is applied to matches that of the local player. Used in TF2 for [[func_respawnroomvisualizer]].|arguments=
; <code>resultVar</code>
: This value is 1 if the local player is on the same team and 0 if the local player is not.
}}
{{MatProxyCell|title=PlayerView|desc=The [[dot product]] of the player's view angle and the relative [[origin]] of the material's entity.|arguments=
; <code>scale</code>
: The value is rescaled to be between 0 and the scale value.
; <code>resultVar</code>
}}
{{MatProxyCell|title=PlayerSpeed|desc=Speed of the local player.|arguments=
; <code>scale</code>
: The value is multiplied by this value. This factor defaults to <code>0.005</code>.
; <code>resultVar</code>
}}
{{MatProxyCell|title=PlayerPosition|desc=The local player's position.|arguments=
; <code>scale</code>
: The value is multiplied by this value. This factor defaults to <code>0.005</code>.
; <code>resultVar</code>
: Set to the vector position.
}}
{{MatProxyCell|title=EntitySpeed|desc=The material's entity's speed.|arguments=
; <code>resultVar</code>
: The current speed of this entity, in units per second.
}}


<div style="-moz-column-count:2;-webkit-column-count:2;column-count:2;">
{{MatProxyCell|title=EntityOrigin|desc=The material's entity's origin. The variable set cannot be changed.|arguments=
; <code>Sine</code>
; <code>$entityorigin</code>
: ''A [[w:sine wave|sine wave]].''
: Set to the origin of the entity.
:; <code>sineperiod</code>
}}
:: Period between wave peaks, in seconds.
{{MatProxyCell|title=EntityRandom|desc=A static random number associated with the entity the material is applied to. Helpful for staggering effects that appear on multiple objects.|arguments=
:; <code>sinemin</code>
; <code>scale</code>
:; <code>sinemax</code>
: The value is rescaled to be between 0 and the scale value.
:: Values at the top and bottom of the wave
; <code>resultVar</code>
:; <code>timeoffset</code>
{{bug|hidetested=1|Entities using this in {{portal}} will cause a crash the moment that they move through a portal.}}
:: Used to offset the starting position of the wave
}}
:; <code>resultVar</code>
{{MatProxyCell|title=Health|desc=The material's entity's health (0-1).|arguments=
; <code>LinearRamp</code>
; <code>scale</code>
: ''An ever-increasing [[float]] value.''
: The value is rescaled to be between 0 and the scale value.
:; <code>rate</code>
; <code>resultVar</code>
:: Units per {{confirm|second}}.
{{bug|hidetested=1|Does not work in most games. The game maintains a cache of unique keys in [[KeyValues]] case-insensitive, while material proxies are internally a case-sensitive lookup. This causes the lookup to fail as a KeyValues file with a lowercase <code>health</code> key defined is parsed (e.g. [[Prop_data#Gibs|propdata.txt]]) before the material. This can be workarounded by adding an uppercase <code>Health</code> key into [[gameinfo.txt]] or defining the material proxy lowercase in the client code.}}
:; <code>initialValue</code>
}}
:; <code>resultVar</code>
{{MatProxyCell|title=IsNPC|desc=Returns whether the material is applied to a NPC. Used in HL2 for [[npc_hunter]]'s eye glow, which is supposed to stay off on ragdolls.|arguments=
; <code>CurrentTime</code>
; <code>scale</code>
: ''The number of seconds the current map has been running on the server for.''
: The value to return when the material is applied to a NPC. Despite the name, nothing in this process is actually multiplied. (although this must be a float)
:; <code>resultVar</code>
; <code>resultVar</code>
; <code>Exponential</code>
: If the material is applied to a NPC, this value is equal to <code>scale</code>. Otherwise, this value stays at 0.
: ''A value that [[Wikipedia:Exponential function|changes at a faster and faster rate]].''
}}
:; <code>srcVar1</code>
{{MatProxyCell|title=WorldDims|desc=The dimensions of the [[world]] entity. The variables set cannot be changed.|arguments=
:: The exponent with which to calculate
; <code>$world_mins</code>
:; <code>offset</code>
: Set to the minimum X/Y/Z coordinates.
:: Offset for exponent
; <code>$world_maxs</code>
:; <code>minVal</code>
: Set to the maximum X/Y/Z coodinates.
:; <code>maxVal</code>
}}
:: Upper and lower value clamps
{{MatProxyCell|title=CrosshairColor|desc=The color of the local player's crosshair. cl_crosshaircolor_(r, g, b) |arguments=
:; <code>scale</code>
; <code>resultVar</code>
:; <code>resultVar</code>
: Returns [r g b] with values from 0 to 1.
:: scale * exp( srcVar1 + offset ) {{tip|1=exp(5) = 148.413159}}
}}
; <code>UniformNoise</code>
: ''A noisy signal where each value is equally likely to occur.''
:; <code>minVal</code>
:; <code>maxVal</code>
:; <code>resultVar</code>
; <code>GaussianNoise</code>
: ''A noisy signal where values are biased towards the average.''
:; <code>mean</code>
:: The average value around which the noise will centre
:; <code>halfWidth</code>
:: The distance from the average at which it's only 30% likely to occur. {{todo|WTF?}}
:; <code>minVal</code>
:; <code>maxVal</code>
:; <code>resultVar</code>
; <code>MatrixRotate</code>
: ''A [[rotation matrix]] from the provided axis and angle.''
:; <code>axisVar</code>
:: Axis of rotation, in the format <code>[x y z]</code>
:; <code>angle</code>
:: Degrees of rotation around axis.
:; <code>resultVar</code>
:: {{todo|Output format}}
; <code>PlayerProximity</code>
: ''The distance between the entity the material is applied to and the local player.''
:; <code>scale</code>
:; <code>resultVar</code>
; <code>PlayerView</code>
: ''The [[dot product]] of the player's view angle and the relative [[origin]] of the material's entity.''
:; <code>scale</code>
:; <code>resultVar</code>
; <code>PlayerSpeed</code>
: ''Speed of the local player.''
:; <code>scale</code>
:; <code>resultVar</code>
; <code>PlayerPosition</code>
: ''The local player's position.''
:; <code>scale</code>
:; <code>resultVar</code>
:: = <code>[x y z]</code>
; <code>PlayerDamageTime</code>
: ''The number of seconds since the local player was last damaged.''
:; <code>scale</code>
:; <code>resultVar</code>
; <code>EntitySpeed</code>
: ''The material's entity's speed.''
:; <code>scale</code>
:; <code>resultVar</code>
; <code>EntityRandom</code>
: ''A static random number associated with the entity the material is applied to. Helpful for staggering effects that appear on multiple objects.''
:; <code>scale</code>
:; <code>resultVar</code>
</div>
</div>


== Texture manipulation ==
== Texture manipulation ==
<div style="display:grid; grid-template-columns:repeat(auto-fit, minmax(24em, auto));">
{{MatProxyCell|title=AnimatedTexture|desc=Increments the current frame of an animated VTF.|arguments=
; <code>animatedTextureVar</code>
: Texture to increment frame for.
: ( i.e. <code>$basetexture</code>, <code>$bumpmap</code>, <code>$normalmap</code>, <code>$envmapmask</code>, <code>$detail</code>)
; <code>animatedTextureFrameNumVar</code>
: Frame variable to increment.
: ( i.e. <code>$frame</code>, <code>$bumpframe</code>, <code>$envmapmaskframe</code>, <code>$detailframe</code>)
; <code>animatedTextureFrameRate</code>
: Framerate in frames per second. Fixed; cannot be changed once set.
; <code>animationNoWrap</code>
: If 1, prevents the animation from looping.
}}
{{MatProxyCell|title=AnimatedEntityTexture|desc=Identical to AnimatedTexture, except the entity controls when the animation starts and is "notified" when the animation is wrapped.|arguments=
; <code>animatedTextureVar</code>
; <code>animatedTextureFrameNumVar</code>
; <code>animatedTextureFrameRate</code>
; <code>animationNoWrap</code>
}}
{{MatProxyCell|title=AnimatedOffsetTexture|desc=Identical to AnimatedTexture, except the animation begins when the entity it's applied to spawns.|arguments=
; <code>animatedTextureVar</code>
; <code>animatedTextureFrameNumVar</code>
; <code>animatedTextureFrameRate</code>
; <code>animationNoWrap</code>
}}
{{MatProxyCell|title=AnimateSpecificTexture|desc=Identical to AnimatedTexture, except only the specified texture could be animated.|arguments=
; <code>animatedTextureVar</code>
; <code>animatedTextureFrameNumVar</code>
; <code>animatedTextureFrameRate</code>
; <code>animationNoWrap</code>
; <code>onlyAnimateOnTexture</code>
: The full path for the texture that this proxy should function with.
{{todo|What is this used for? None out of around 40 thousand official Valve .vmt files use this proxy}}
}}
{{MatProxyCell|title=Pupil|desc=Used for character's eyes, computes the light brightness at the material's position and reacts to bright lights by incrementing the texture's frame.|arguments=
; <code>TextureVar</code>
: Texture to increment frame for.
; <code>TextureFrameNumVar</code>
: Frame variable to increment.
; <code>PupilCloseRate</code>
: The maximum speed the pupil can close, in fractions/second. The default is 0.1.
; <code>PupilOpenRate</code>
: The maximum speed the pupil can open, in fractions/second. The default is 0.03.
; <code>$lighting</code>
: This material variable is used to store the previous frame, and should be set to 0.5 in the material. It will be set to the average light value, from 0-1.
}}
{{MatProxyCell|title=TextureTransform|desc=Generates a texture transform matrix for use with [[$basetexturetransform]] etc.|arguments=
; <code>centerVar</code>
; <code>scaleVar</code>
; <code>rotateVar</code>
; <code>translateVar</code>
: Optional input variables for the matrix. Each one can be a [[float]] or a 2D vector.
; <code>resultVar</code>
}}
{{MatProxyCell|title=TextureScroll|desc=Returns a transform matrix or vector that will translate a texture at a given angle at a given rate.|arguments=
; <code>textureScrollVar</code>
: Destination for the resulting transformation.
; <code>textureScrollRate</code>
: Rate of scroll in units per second.
; <code>textureScrollAngle</code>
: Angle of rotation to move along. (90 = up, 180 = left, etc)
; <code>textureScale</code>
: Scale of the texture; defaults to 1.0 if unspecified. Works similarly to the TextureTransform proxy's scaleVar and [[$basetexturetransform]]'s scale component (e.g., 2.0 is a 50% scale). Unlike those, however, textureScale only accepts a single [[float]]—not a 2D vector—so this proxy can't scale a texture's X and Y axes individually.
}}
{{MatProxyCell|title=LampBeam|desc=Modulates the material's alpha value based on angle between the beam's direction and the viewer's eye point. This is used to make the beams of volumetric light on lights fade as you look at them dead on. Must be attached to entity for angle use.
}}
{{MatProxyCell|title=LampHalo|desc=Modulates the material's alpha value based on angle between the beam's direction and the viewer's eye point. Like the LampBeam proxy, but used for the halo at the beam's base. Must be attached to entity for angle use.
}}
</div>
== Entity integration ==
<div style="display:grid;grid-template-columns: repeat(auto-fit, minmax(24em, auto));">
{{MatProxyCell|title=MaterialModify / MaterialModifyAnimated|desc=Used in conjunction with the [[material_modify_control]] entity to configure arbitrary parameters from map I/O. Only works when the material is applied to an entity. MaterialModify takes no parameters. MaterialModifyAnimated takes the same parameters as AnimatedTexture.'' {{note|Searches for <kbd>material_modify_control</kbd> among children of an entity a material with this proxy is rendered on and then applies its effects.}}
}}
{{MatProxyCell|title=WaterLOD|desc=Coordinates water LOD values between the map's [[water_lod_control]] entity and the material's internal values. {{warning|Both of the parameters MUST be defined in the VMT or the proxy will fail.}}|arguments=
; <code>$CHEAPWATERSTARTDISTANCE</code>
: Start distance for cheap water {{note|must be set outside of proxy block.}}
;<code>$CHEAPWATERENDDISTANCE</code>
: End distance for cheap water {{note|must be set outside of proxy block.}}
}}
{{MatProxyCell|title=BreakableSurface|desc=Sets the base texture to a material name held by the entity (used for switching surface material on shatter). Must be attached to a <code>[[func_breakable_surf]]</code> entity.
}}
{{MatProxyCell|title=ConveyorScroll|desc=Returns the scroll parameters for a texture used as a conveyor, so it matches the entity's settings. Must be attached to <code>[[func_conveyor]]</code> entity.|arguments=
; <code>textureScrollVar</code>
: Name of variable to place result in. Must be a matrix or vector type variable (i.e. <code>$baseTextureOffset</code>).
}}
{{MatProxyCell|title=Camo|desc=Only used by material <code>Dev\dev_camo.vmt</code>. This generates a texture matching the surroundings, which appears to be intended to be used for [[Npc_combine_s|Combine Elite]] at some point. Much of the code is disabled, so this is not usable. |arguments=
; <code>$camopatterntexture</code>
: The source texture for the camo effect. Should be I8 format.
; <code>$camoboundingboxmin</code>
; <code>$camoboundingboxmax</code>
: Random points within this bounding box will be sampled to determine the camo coloring.
}}
{{MatProxyCell|title=FleshInterior|desc=Outputs the locations of nearby [[point_flesh_effect_target]]s for use by the [[$flesh]] effect.|arguments=
; <code>$FleshEffectCenterRadius1</code>
; <code>$FleshEffectCenterRadius2</code>
; <code>$FleshEffectCenterRadius3</code>
; <code>$FleshEffectCenterRadius4</code>
: Set to the world locations of four flesh targets, with the fourth axis set to the radius. If a target is not present, all four axes are set to zero.
; <code>$FleshGlobalOpacity</code>
: This material variable has to exist for the proxy to function, but it's not actually set at any point.
; <code>$FleshSubsurfaceTint</code>
: This is just set to <code>[0 0 0 0]</code>.
}}
{{MatProxyCell|title=HeliBlade|desc=Controls transition on [[npc_helicopter]]'s blades. This fades in or out the blades to convert from a set of physical blades into a spinning blurred circle.|arguments=
; <code>$fadeout</code>
: If the variable is set to 1, fade out the blades as it starts up. If 0, fade in.
; <code>$alpha</code>
: This proxy sets the value of the alpha variable.
}}
{{MatProxyCell|title=ParticleSphereProxy|desc=Only used by material <code>particle\SmokeStack.vmt</code>. Seems to be defined in <code>particle_proxies.cpp</code>. Valve remark: "FIXME:  Is this even needed any more?"
}}
{{MatProxyCell|title=PlayerLogo|desc=Internal proxy for "decals/playerlogo##" decals. Generates and assigns a texture for a specific player index.}}
{{MatProxyCell|title=Shadow|desc=Only used by [[Shadow (shader)|Shadow]]. No known parameters. This sets lots of material parameters to render projected texture shadows.
}}
{{MatProxyCell|title=ShadowModel|desc=Only used by [[Shadow (shader)|ShadowModel]]. No known parameters. This sets lots of material parameters for rendering projected texture shadows.
}}
{{MatProxyCell|title=Thermal|desc=Uses <code>[[$color]]</code> vectors and work around <code>$ThermalPeriod</code>, <code>$ThermalMin</code>, and <code>$ThermalMax</code> to generate a Hue scaled Sine and applies back to <code>$color</code>.|arguments=
; <code>[[$color]]</code>
: Uses [[$color]] as <code>ThermalVar</code> internal reference and proxie output.
; <code>$ThermalPeriod</code>
: Duration to be curl from game's Current Time. Default: [[Float|1.0]].
; <code>$ThermalMin</code>
; <code>$ThermalMax</code>
: Min/Max values to multiply over sine's by product while prevent go lower than <code>$ThermalMin</code>
}}
{{MatProxyCell|title=ToggleTexture|desc=Toggles a texture based on the frame number [[SetTextureFrameIndex()|set by game code]] (in most games, only via [[env_texturetoggle]]). Must be attached to an entity.|arguments=
; <code>toggleTextureVar</code>
: Texture to modify based on frames.
; <code>toggleTextureFrameNumVar</code>
: Variable used for frame number.
; <code>toggleShouldWrap</code>
: Whether the animation should wrap over not. Enabled by default.
:{{confirm|Disabling wrapping probably doesn't work correctly if [[env_texturetoggle]]'s {{mono|IncrementTextureIndex}} input is called 256 times due to {{w|integer overflow}}.}}
}}
</div>
== Utility ==
{{MatProxyCell|title=Empty|desc=Used to comment out proxies. Surround a bunch of proxies with the empty proxy to cause those proxies to not operate.
}}
{{MatProxyCell|title=Dummy|desc=Prints {{ent|developer}} messages in response to the proxy being created, the proxy being initialized, the proxy being bound to an entity, and the proxy being removed.
}}
== Miscellaneous ==
{{L4D|since}}
{{MatProxyCell|title=ConVar|desc=Allows you to link a specific variable to a ConVar a client has set.|arguments=
; <code>convar</code>
: The ConVar name to link to, e.g. <code>mat_specular</code>. {{note|Strings will not be parsed through, the value of the ConVar must be a number.}}
; <code>resultVar</code>
: Returns the value of the ConVar. If this is a vector type, all axes will be set individually to the ConVar's value.
}}
== Game Specific ==
=== {{hl2|4}} ===
<hr>
<div style="display:grid; grid-template-columns:repeat(auto-fit, minmax(24em, auto));">
{{MatProxyCell|title=EntityOriginAlyx|desc=Identical to EntityOrigin with an x offset of 15. Created as a last-minute hack before The Orange Box shipped.
}}
{{MatProxyCell|title=Ep1IntroVortRefract|desc=Uses <code>$refractamount</code> to generate a ratio and sends it to the same variable, not using <code>resultVar</code>. Created as a last-minute hack before The Orange Box shipped.}}
{{MatProxyCell|title=VortEmissive|desc=Sets <code>$emissiveblendstrength</code> and <code>$detailblendfactor</code> to apply the Vortigaunt's blue-purple glow effects in Episode 1's opening.}}
{{MatProxyCell|title=Shield|desc=Likely intended to be used for one of the Combine shield types. This is equivalent to a combination of the TextureScroll and Alpha proxies.|arguments=
; <code>$translucency</code>
: This variable is set to the Render Alpha value of the attached entity, similar to the Alpha proxy.
; <code>textureScrollVar</code>
; <code>textureScrollRate</code>
; <code>textureScrollAngle</code>
: Has identical functionality to the TextureScroll proxy.
}}
</div>


<div style="-moz-column-count:2;-webkit-column-count:2;column-count:2;">
==={{tf2|4}}===
; <code>TextureTransform</code>
<hr>
: Generates a texture transform matrix.
<div style="display:grid; grid-template-columns:repeat(auto-fit, minmax(24em, auto));">
:; <code>centerVar</code>
{{MatProxyCell|title=invis|desc=Works if [[VertexLitGeneric#Cloak|$cloakPassEnabled]] is true. Supports both world models and view models, but doesn't have team color support.
:: Name of a variable holding the center of rotation and scaling. [Optional]
}}
:; <code>scaleVar</code>
{{MatProxyCell|title=spy_invis|desc=Works if $cloakPassEnabled is true. Used in player world model materials. No parameters. Cloak color will be team-colored on players by default. Incompatible with $weapon_invis and $vm_invis.
:: Name of scale variable (2D vector). [Optional]
}}
:; <code>rotateVar</code>
{{MatProxyCell|title=weapon_invis|desc=Works if $cloakPassEnabled is true. Used in weapon world model materials. No parameters. Incompatible with $spy_invis and $vm_invis.
:: Name of rotation angle variable (float). [Optional]
}}
:; <code>translateVar</code>
{{MatProxyCell|title=vm_invis|desc=Works if $cloakPassEnabled is true. Used in player and weapon view model materials. No parameters. Incompatible with $spy_invis and $weapon_invis.
:: Name of the translation variable (2D vector).
}}
:; <code>resultVar</code>
{{MatProxyCell|title=building_invis|desc=Unused, intended to be used in building model materials to support cloaking.
:: Resulting value.
}}
; <code>Empty</code>
{{MatProxyCell|title=CommunityWeapon|desc=Passes the value 1 when item is flagged as a [https://wiki.teamfortress.com/wiki/Community_(quality) Community quality] item. Passes 0 otherwise.|
: Used to comment out proxies. Surround a bunch of proxies with the empty proxy to cause those proxies to not operate.
arguments=
; <code>TextureScroll</code>
; <code>resultVar</code>
: Returns a transform matrix or vector that will translate a texture at a given angle at a given rate.
}}
:; <code>textureScrollVar</code>
{{MatProxyCell|title=InvulnLevel|desc=Passes a float value to set the opacity of the invulnerability effect when a player has been [https://wiki.teamfortress.com/wiki/ÜberCharge ÜberCharged].|
:: Destination for the resulting transformation.
arguments=
:; <code>textureScrollRate</code>
; <code>resultVar</code>
:: Rate of scroll in units per second.
}}
:; <code>textureScrollAngle</code>
{{MatProxyCell|title=BurnLevel|desc=Passes a float value to set the opacity of the fire overlay effect when a player is on fire.|
:: Angle of rotation to move along. (90 = up, 180 = left, etc)
arguments=
; <code>ToggleTexture</code>
; <code>resultVar</code>
: Toggles a texture based on the frame number set by the attached entity. {{Note|Must be attached to an entity.}}
}}
:; <code>toggleTextureVar</code>
{{MatProxyCell|title=YellowLevel|desc=Passes an RGB value when [https://wiki.teamfortress.com/wiki/Jarate Jarate] has been used on a player.|
:: Texture to modify based on frames.
arguments=
:; <code>toggleTextureFrameNumVar</code>
; <code>resultVar</code>
:: Variable used for frame number.
}}
:; <code>toggleShouldWrap</code>
{{MatProxyCell|title=ModelGlowColor|desc=When active, passes hard coded color value to create the [https://wiki.teamfortress.com/wiki/Critical_hits#Special_cases crit] glow effect. Color is either red or blue. When inactive value is pure white (255 255 255).|
:: Whether the animation should wrap over not.
arguments=
; <code>LampBeam</code>
; <code>resultVar</code>
: Modulates the material's alpha value based on angle between the beam's direction and the viewer's eye point. This is used to make the beams of volumetric light on lights fade as you look at them dead on.<br>{{Note|Must be attached to entity for angle use.}}
}}
; <code>LampHalo</code>
{{MatProxyCell|title=ItemTintColor|desc=Passes an RGB value when a [https://wiki.teamfortress.com/wiki/Paint Paint Can] is used. Value is specific to Paint color. Passes 0 when no Paint is used.|
: Modulates the material's alpha value based on angle between the beam's direction and the viewer's eye point.
arguments=
: Like the LampBeam proxy, but used for the halo at the beam's base. {{Note|Must be attached to entity for angle use.}}
; <code>resultVar</code>
: No return value.
}}
; <code>AnimatedTexture</code>
{{MatProxyCell|title=BuildingRescueLevel|desc=Passes a transform matrix to set the amplitude of the [https://wiki.teamfortress.com/wiki/Rescue_Ranger Rescue Ranger] display.|
: Increments frame variable {{note|animatedtextureframerate can NOT be set to a local var to be changed on the fly. It's a fixed variable, unfortunately}}
arguments=
:; <code>animatedtexturevar</code>
; <code>resultVar</code>
:: Texture to increment frame for (i.e. <code>$basetexture</code>, <code>$bumpmap</code>, <code>$normalmap</code> (both <code>$bumpmap</code> and <code>$normalmap</code> use <code>$bumpframe</code>))
}}
:; <code>animatedtextureframenumvar</code>
{{MatProxyCell|title=TeamTexture|desc=Changes the animation frame of the texture depending on the current team.|
:: Frame variable to increment (i.e. <code>$frame</code>, <code>$bumpframe</code>)
arguments=
:; <code>animatedtextureframerate</code>
; <code>resultVar</code> - Only writes to <code>$frame</code>
:: Framerate in frames per second.
}}
{{MatProxyCell|title=AnimatedWeaponSheen|desc=Performs the [https://wiki.teamfortress.com/wiki/Killstreak_Kit#Specialized_Killstreak_Kit killstreak sheen effect].
|arguments=
; <code>animatedtexturevar</code>
; <code>animatedtextureframenumvar</code>
; <code>animatedtextureframerate</code>
}}
{{MatProxyCell|title=WeaponSkin|desc=Sets basetexture for Decorated items.
}}
{{MatProxyCell|title=ShieldFalloff|desc=Pulses the [https://wiki.teamfortress.com/wiki/Vaccinator Vaccinator's] Über shield.
}}
{{MatProxyCell|title=StatTrakIllum|desc=Returns 0.75 on viewmodels.
|arguments=
; <code>resultVar</code>
}}
{{MatProxyCell|title=StatTrakDigit|desc=Returns one digit of the item's Strange counter. If trimZeros is positive, leading zeroes will return 10 instead.
|arguments=
; <code>resultVar</code>
; <code>displayDigit</code>
; <code>trimZeros</code>
}}
{{MatProxyCell|title=StatTrakIcon|desc=Non-functional. Returns a constant matrix.
|arguments=
; <code>resultVar</code>
}}
{{MatProxyCell|title=StickybombGlowColor|desc=When active, passes hard coded color value to create the '[https://wiki.teamfortress.com/wiki/Scottish_Resistance Scottish Resistance]' selection effect. Color is either red or blue.|
arguments=
; <code>resultVar</code>
}}
{{MatProxyCell|title=SniperRifleCharge|desc=Returns a transform matrix for the [https://wiki.teamfortress.com/wiki/Sniper_Rifle Sniper Rifle] charge up. Other weapons can affect the return value such as melee weapons and the Medi Gun|
arguments=
; <code>resultVar</code>
}}
{{MatProxyCell|title=Heartbeat|desc=Returns a time-varying value between 0.48 and 0.6 (mostly 0.6) to simulate a heartbeat.
|arguments=
; <code>resultVar</code>
}}
{{MatProxyCell|title=WheatlyEyeGlow|desc=Pulsates a color with Gaussian Distribution. Used for the [https://wiki.teamfortress.com/wiki/Ap-Sap Ap-Sap] item.|
arguments=
; <code>resultVar</code>
}}
{{MatProxyCell|title=BenefactorLevel|desc=Used for scaling the beating heart based on the number of [https://wiki.teamfortress.com/wiki/Secret_Saxton gifts] the player has given. Returns a texture scale factor where 1 is max size (big benefactor) and factor gets larger the fewer gifts you've given.|
arguments=
; <code>resultVar</code>
}}
{{MatProxyCell|title=CustomSteamImageOnModel|desc=Replaces the $baseTexture with a custom texture. No parameters.
{{note|This is used to make it possible to use the decal tool on hats in {{tf2}}, for example.}}
}}
</div>
</div>


== Entity integration ==
=== {{l4d2|4}} ===
<hr>
<div style="display:grid; grid-template-columns:repeat(auto-fit, minmax(24em, auto));">
{{MatProxyCell|title=PlayerTeam|desc=Returns a value depending on the team the player is currently in.|arguments=
; <code>team</code>
: Unknown
; <code>resultVar</code>
: 0 = survivor / 1 = infected / 2 = spectator
}}
{{MatProxyCell|title=BloodyHands|desc=Returns a value between 0 and 1 depending on the number of hits with a melee weapon.|arguments=
; <code>resultVar</code>
: number of hits / 5
: doesn't go over 1 after 5 hits
: value is shared between world and view model
}}
{{MatProxyCell|title=IT|desc=Returns a value between 0 and 1 depending on the fact that the survivor is covered in Boomer bile.|arguments=
; <code>resultVar</code>
: 1 = fully covered / 0 = not covered
}}
{{MatProxyCell|title=BurnLevel|desc=Passes a float value to set the opacity of the fire overlay effect when an infected has been burned.|arguments=
; <code>resultVar</code>
: 1 = on fire / 0 = not on fire
}}
{{MatProxyCell|title=BBQLevel|desc=Seen in <code>materials\models\infected\hulk\hulk_01.vmt</code>|arguments=
; <code>resultVar</code>
}}
</div>
 
==={{as|4}}===
<hr>
<div style="display:grid; grid-template-columns:repeat(auto-fit, minmax(24em, auto));">
{{MatProxyCell|title=NightVisionSelfIllum|desc=When the player has a night vision effect or sniper scope active, outputs a strength to modulate selfillumination on objects.|arguments=
; <code>resultVar</code>
: The value to change. Generally set to <code>$selfillumtint</code>.
; <code>asw_night_vision_self_illum_multiplier</code>
: This ConVar specifies the value output when night vision is on at full strength.
; <code>asw_sniper_scope_self_illum_multiplier</code>
: This ConVar specifies the value output when the sniper scope is active.
}}
{{MatProxyCell|title=AlienSurfaceFX|desc=Sets the [[$detail]] texture and parameters to display fire, freezing and electrical shock effects.|arguments=
; <code>texturescrollvar</code>
: Set to the name of the matrix or transform variable that shifts the detail texture, usually <code>$detailtexturetransform</code>.
}}
{{MatProxyCell|title=LanguagePreference|desc={{asrd|only}} Sets a value based on the client's language setting.|arguments=
; <code>resultVar</code>
: The variable to change. (eg. <code>$basetexture</code>)
; <code>default</code>
: The default value for the variable if no listed language matches.
; <code>english</code>, <code>french</code>, <code>schinese</code>, etc.
: Specific values for specific languages.
}}
</div>
 
==={{portal|4}} and {{portal2|4}}===
<hr>
<div style="display:grid; grid-template-columns:repeat(auto-fit, minmax(24em, auto));">
{{MatProxyCell|title=PortalOpenAmount|desc=On portals, transitions from 0 to 1 as the portal opens.|arguments=
; <code>resultVar</code>
}}
{{MatProxyCell|title=PortalStatic|desc=On portals, specifies how much the opaque static effect should render. 1 is a unpaired portal, 0 is an open portal.|arguments=
; <code>resultVar</code>
}}
</div>
 
==={{portal2|4}} only===
<hr>
<div style="display:grid; grid-template-columns:repeat(auto-fit, minmax(24em, auto));">
{{MatProxyCell|title=FizzlerVortex|desc=Sets various parameters used by the [[SolidEnergy]] shader for [[Fizzler|fizzler]] effects - the location of nearby objects, flashing from portal shots, and power transition times. Doesn't take any arguments.|arguments=
; <code>$powerup</code>
: Transitions to 0 when the fizzler is turned off, 1 when turned on.
; <code>$FLOW_VORTEX1</code>
: Set to 1 when an object is brought near the field, otherwise set to 0.
; <code>$FLOW_VORTEX_POS1</code>
: Set to the position of the first object.
; <code>$FLOW_VORTEX2</code>
: Set to 1 when a second object is brought near the field, otherwise set to 0.
; <code>$FLOW_VORTEX_POS2</code>
: Set to the position of the second object.
{{todo|What parameter does the portal shot flash set?}}
}}
{{MatProxyCell|title=WheatlyEyeGlow|desc=Presumably controls the glow effect on Wheatley. Not actually used.<br>{{todo|Does this do anything? Seems to have been replaced by Lightedmouth.}}
}}
{{MatProxyCell|title=Lightedmouth|desc=Used on the various [[npc_personality_core|Personality Cores]] and PoTaTOS to blink their eye-light in sync with their choreo scenes. When idle, the tint is still partially lit. On the viewmodel, it can also be manually controlled via VScript to make GLaDOS appear to shut down.|arguments=
; <code>resultVar</code>
: A tint to pass to <code>$selfillumtint</code>.
}}
{{MatProxyCell|title=LightedFloorButton|desc=Used on the clean Super Button materials, sets $selfillumtint to 1 if the material is being used on a {{ent|prop_floor_button}}, otherwise sets it to 0. This has no real benefit and just causes the model to appear incorrectly when used on other entities, it was presumably a beta leftover.|arguments=
; <code>resultVar</code>
: The tint to use, or <code>[0 0 0]</code> if not on a button.
}}
{{MatProxyCell|title=TractorBeam|desc=Used on the [[prop_tractor_beam|Excursion Funnel]] effect materials, outputs the scroll rate and does other unknown operations.|arguments=
; <code>resultVar</code>
: Passed to the <code>textureScrollRate</code> parameter of various TextureScroll proxies.
}}
</div>
 
==={{bms|4}}===
<div style="display:grid; grid-template-columns:repeat(auto-fit, minmax(24em, auto));">
{{MatProxyCell|title=TauCharge|desc=Seen in <code>materials/models/weapons/<wbr>v_gauss/v_taucannon_core.vmt</code>.|arguments=
; <code>resultVar</code>
}}
 
{{MatProxyCell|title=WebBurnFactorProxy|desc=Seen in <code>materials/models/props_xen/<wbr>gonarch/gon_web_tough_burnable.vmt</code>.|arguments=
; <code>resultVar</code>
}}
 
{{MatProxyCell|title=ModelDetailFx|desc=Seen in <code>materials/models/weapons/<wbr>v_gauss/v_taucannon_core.vmt</code>.
}}
 
{{MatProxyCell|title=AnimatedWeaponSheen|desc=Seen in <code>materials/models/<wbr>world_models/w_357_mp.vmt</code>.
}}
</div>
 
==={{csgo|4}}===
<hr>
<div style="display:grid; grid-template-columns:repeat(auto-fit, minmax(24em, auto));">
{{MatProxyCell|title=Select|desc=Picks a result value depending on the input value, like a [[w:Switch statement|switch statement]].|arguments=
; <code>srcVar1</code>
; <code>resultVar</code>
; <code>default</code>
: The default return value if the value of <code>srcVar1</code> does not match any case.
; ''<code><case></code>''
: The return value if the value of <code>srcVar1</code> has the value <code><case></code>. There can be multiple cases.''
''Example from <code>materials/models/inventory_items/<wbr>dogtags/dogtags_lightray.vmt</code>:
<pre style="background:#444; color:#eeeeee; border-color:#666">
"srcVar1"  "$localTeamNumber"
"resultVar" "$color"
"default"  "[0.680 0.680 0.680]"
"2"        "[0.680 0.544 0.136]"
"3"        "[0.269 0.474 0.680]"
</pre>
{{todo|Works for other case types? Other games?}}
}}
{{MatProxyCell|title=GetTeamNumber|desc=Gets the team of an entity. Seen in <code>materials/models/inventory_items/<wbr>dogtags/dogtags_lightray.vmt</code>.|arguments=
; <code>resultVar</code>
:*0: Unassigned
:*1: Spectator
:*2: Terrorist
:*3: Counter-Terrorist
{{todo|Other games?}}
}}
{{MatProxyCell|title=survivalteammate|desc=Used to paint the teammate in {{csgo mode|Dz}}. Seen in <code>materials/models/player/custom_player/econ/<wbr>body/tm_jumpsuit/jumpsuit_body.vmt</code>.|arguments=
; <code>resultVar</code>
: Returns 1 if the local player is the teammate of the player that the material is applied to and 0 if not.{{note|Always returns 0 outside of Danger Zone — use GetTeamNumber instead!}}
}}
{{MatProxyCell|title=RemapValClamp|desc=Remaps a variable within the specified ranges.|arguments=
; <code>range_in_min</code>
; <code>range_in_max</code>
; <code>range_out_min</code>
; <code>range_out_max</code>
; <code>srcVar1</code>
; <code>resultVar</code>
}}
{{MatProxyCell|title=Modulo|desc=Divides the first variable by the second and writes the remainder value to the resultvar.|arguments=
; <code>srcVar1</code>
; <code>srcVar2</code>
; <code>resultVar</code>
}}
{{MatProxyCell|title=MoneyProxy|desc=Reads from the players money value. Only works on viewmodel materials.|arguments=
; <code>resultVar</code>
}}
{{MatProxyCell|title=WeaponLabelText|desc=Calculates where to offset the $basetexture based on the displaydigit value. Only works on the viewmodel.|arguments=
; <code>displaydigit</code>
}}
{{MatProxyCell|title=C4CompassArrow|
; <code>resultvar</code>
}}
{{MatProxyCell|title=IronSightAmount|desc=Returns 1 when the player is scoped in, 0 when scoped out.|arguments=
; <code>invert</code>
; <code>resultvar</code>
}}
{{MatProxyCell|title=ApproachValue|desc=Performs a smooth transition from the current value of srcVar1 to the targetvalue of srcVar2.|arguments=
; <code>srcVar1</code>
; <code>srcVar2</code>
; <code>speed</code>
: specifies how quickly the transition happens, with a higher value leading to a faster transition.
; <code>resultVar</code>
: the result of the transition is stored in the resultvar.
}}
</div>


<div style="-moz-column-count:2;-webkit-column-count:2;column-count:2;">
==={{titanfall|4}} and {{titanfall2|4}}===
; <code>MaterialModify</code>
<hr>
: Sets the base texture to a value held by the entity (used for entity controlled texture animations). {{Note|Only works when attached to an entity.}}
<div style="display:grid; grid-template-columns:repeat(auto-fit, minmax(24em, auto));">
; <code>WaterLOD</code>
{{MatProxyCell|title=ADSFraction|desc=Returns a value between 0 and 1, depending on how much the player is adsing.|arguments=
: Coordinates water LOD values between the map's [[env_waterlod]] entity and the material's internal values.
; <code>use_weapon_settings</code>
:; <code>$CHEAPWATERSTARTDISTANCE</code>
: If set, uses the weapon's <code>zoom_scope_frac_start</code> and <code>zoom_scope_frac_end</code> settings.
:: Start distance for cheap water {{note|must be set outside of proxy block.}}
; <code>startFrac</code>
:;<code>$CHEAPWATERENDDISTANCE</code>
; <code>endFrac</code>
:: End distance for cheap water {{note|must be set outside of proxy block.}}
; <code>invert</code>
; <code>BreakableSurface</code>
; <code>spline</code>
: Sets the base texture to a material name held by the entity (used for switching surface material on shatter)<br>{{Note|Must be attached to a <code>func_breakablesurface</code> entity.}}
; <code>scale</code>
; <code>ConveyorScroll</code>
; <code>resultVar</code>
: Returns the scroll parameters for a texture used as a conveyor. <br>{{Note|Must be attached to <code>func_conveyor</code> entity.}}
}}
:; <code>textureScrollVar</code>
{{MatProxyCell|title=ADSFOVTarget|arguments=
:: Name of variable to place result in.
; <code>range</code>
{{note|must be a matrix or vector type variable (i.e. <code>$baseTextureOffset</code>).}}
; <code>invert</code>
; <code>Camo</code>
; <code>resultVar</code>
: {{note|Only used by material "Dev\dev_camo.vmt".}}
}}
:; <code>camopatterntexture</code>
{{MatProxyCell|title=BackgroundAmmoColor|desc=Passes an RGB value according to the current clip of the player's weapon. Goes from blue -> orange -> red.|arguments=
:: {{todo}}
; <code>resultVar</code>
:; <code>camoboundingboxmin</code>
}}
:: {{todo}}
{{MatProxyCell|title=ClipAmmo|desc=Returns the current clip of the player's current weapon.|arguments=
:; <code>camoboundingboxmax</code>
; <code>resultVar</code>
:: {{todo}}
}}
:; <code>surfaceprop</code>
{{MatProxyCell|title=ClipAmmoColor|desc=Similar to <code>BackgroundAmmoColor</code>, but the ammount where the value changes is different.|arguments=
; <code>HeliBlade</code>
; <code>resultVar</code>
: {{todo}}
}}
; <code>ParticleSphereProxy</code>
{{MatProxyCell|title=CockpitLights
: {{note|Only used by material "particle\SmokeStack.vmt".}} Seems to be defined in <code>particle_proxies.cpp</code>. Valve remark: "FIXME:  Is this even needed any more?"
}}
; <code>Shadow</code>
{{MatProxyCell|title=CockpitOpenAmount
: Only used by material decals\rendershadow.vmt. No known parameters.
}}
; <code>ShadowModel</code>
{{MatProxyCell|title=CockpitScreen
: Only used by material decals\rendermodelshadow.vmt. No known parameters.
}}
{{MatProxyCell|title=EntityScript|desc=Calls a Vscript function and returns a value.|arguments=
; <code>scriptFuncName</code>
; <code>resultVar</code>
}}
{{MatProxyCell|title=Holosight|desc=Similar to <code>ADSFraction</code>, but with seemingly no settings.|arguments=
; <code>resultVar</code>
}}
{{MatProxyCell|title=HoloSightOffset|desc=Base offset from UV centre relative to vector2 $attachment position.|arguments=
; <code>attachmentName</code>
; <code>horizontalScalar</code>
; <code>verticalScalar</code>
; <code>resultVar</code>
''Example from <code>materials/models/weapons/<wbr>attachments/hcog_reticle_front.vmt</code>:
<pre style="background:#444; color:#eeeeee; border-color:#666">
"attachmentName"  "HCOG_REAR"
"horizontalScalar" "0.55"
"verticalScalar"  "-0.72"
"resultVar"        "$holoOffset"
</pre>
}}
{{MatProxyCell|title=MaxCarryAmmo|desc=Returns the max reserve ammo size of the player's current weapon.|arguments=
; <code>resultVar</code>
{{bug|tested=Titanfall 2|Doesn't work if the weapon doesn't use clips.}}
}}
{{MatProxyCell|title=MaxClipAmmo|desc=Returns the max clip size of the player's current weapon.|arguments=
; <code>resultVar</code>
}}
{{MatProxyCell|title=MiniMap|arguments=
; <code>resultVar</code>
}}
{{MatProxyCell|title=NumericCounterAtlasFrame|arguments=
; <code>value</code>
; <code>digitIndex</code>
; <code>resultAtlasFrameIndexVar</code>
}}
{{MatProxyCell|title=ProgressBar|arguments=
; <code>value</code>
; <code>max</code>
; <code>resultVar</code>
: The result is a transformation matrix.
}}
{{MatProxyCell|title=RemainingAmmo|desc=Returns the current reserve ammo of the player's current weapon.|arguments=
; <code>resultVar</code>
{{bug|tested=Titanfall 2|Doesn't work if the weapon doesn't use clips.}}
}}
{{MatProxyCell|title=RemainingAmmoColor|desc= Similar to <code>BackgroundAmmoColor</code>, but uses the weapon's reserve ammo instead.| arguments=
; <code>resultVar</code>
{{bug|tested=Titanfall 2|Doesn't work if the weapon doesn't use clips.}}
}}
{{MatProxyCell|title=RemainingClipCount|desc=Returns the max reserve ammo divided by the max clip size of the player's current weapon.|arguments=
; <code>resultVar</code>
}}
{{MatProxyCell|title=ScriptModify|desc=Calls a Vscript function and returns a value.|arguments=
; <code>scriptFuncName</code>
; <code>resultVar</code>
''Example from <code>materials/vgui/hud/compass_ticker.vmt</code>:
<pre style="background:#444; color:#eeeeee; border-color:#666">
"scriptFuncName" "VMTCallback_CompassTickerOffset"
"resultVar" "$offset"
</pre>
{{confirm|Identical to <code>EntityScript</code>?}}
}}
{{MatProxyCell|title=TextureAtlas|arguments=
; <code>frameSize</code>
; <code>frameStart</code>
; <code>resultVar</code>
}}
{{MatProxyCell|title=TickCounterAtlasFrames|arguments=
; <code>tickCount</code>
; <code>rowLength</code>
; <code>rowIndex</code>
; <code>atlasFrameSize</code>
; <code>resultAtlasFrameStartVar</code>
; <code>resultAtlasFrameCountVar</code>
}}
{{MatProxyCell|title=WeaponChargeFraction|desc=Returns a value between 0 and 1, depending on the charge amount of the player's current weapon.|arguments=
; <code>resultVar</code>
}}
</div>
</div>


== See also ==
== See also ==
* [[Material Proxies]]
* [[Material Proxies]]
* [[Material Creation]]
* [[Material Creation]]


[[Category:Material System]]
[[Category:Material System]]
[[Category:Lists]]

Latest revision as of 15:06, 20 May 2025

English (en)Español (es)中文 (zh)Translate (Translate)
Main article:  Material proxies

All material proxies usable in materials at all Source 2013 games can be found here, along with proxies only present in specific games. (Mostly other Valve titles)

Todo: There are still lots of undocumented proxies / proxies lacking enough documentation!
Icon-Important.pngImportant:Unlike material variables, material proxy names are case sensitive.

Calculation

Note.pngNote:Operations involving integers of all these proxies will be converted to a float result value, except for Equals and Clamp.

Add Adds two variables.

srcVar1
srcVar2
resultVar
Returns srcVar1 + srcVar2.

Multiply Multiplies two variables.

srcVar1
srcVar2
resultVar
Returns srcVar1 * srcVar2.

Subtract Subtracts the second variable from the first.

srcVar1
srcVar2
resultVar
Returns srcVar1 - srcVar2.

Divide Divides the first variable by the second.

srcVar1
srcVar2
resultVar
Returns srcVar1 / srcVar2.

Equals Copies the value of a variable to another.

srcVar1
resultVar
Returns srcVar1.

Abs Computes the absolute (i.e. unsigned) value of a variable.

srcVar1
resultVar
Returns abs(srcVar1).

Frac

Returns the fractional component of a variable. For integer values, no change occurs.
Tip.pngTip:frac(4.23) = .23
srcVar1
resultVar

Int

Returns the integer component of a variable.
Tip.pngTip:int(4.23) = 4
srcVar1
resultVar

Clamp Keeps a variable within a specified range. srcVar1 and resultVar can be the same.

min
max
srcVar1
resultVar
Returns the value in the range [min, max] that is the closest to srcVar1.

LessOrEqual Compares the first value to the second.

lessEqualVar
greaterVar
srcVar1
srcVar2
resultVar
If srcVar1 ≤ srcVar2, returns lessEqualVar, otherwise greaterVar.

SelectFirstIfNonZero Selects the first value over the second if it is anything other than zero.

srcVar1
srcVar2
resultVar
If srcVar1 == 0, returns srcVar1, otherwise srcVar2.

WrapMinMax Constrains a value into a range, wrapping around if it exceeds it.

srcVar1
The value to constrain.
minVal
maxVal
Range to constrain the value to. If min is less than max, min is always returned.
resultVar
The variable to write the results to.

Exponential A value that changes at a faster and faster rate.

minVal
maxVal
Upper and lower value clamps.
srcVar1
offset
scale
resultVar
Returns scale * exp( srcVar1 + offset )
Tip.pngTip:exp(n) = en

Number generation

Sine A sine wave.

sineperiod
Period between wave peaks, in seconds.
sinemin
sinemax
Values at the top and bottom of the wave
timeoffset
Used to offset the starting position of the wave
resultVar
Returns sinemin + (sinemax-sinemin)/2 * (1 + sin( 2*pi/sineperiod * (time + timeoffset) )).

LinearRamp An ever-increasing float value.

rate
Units per second.
initialValue
Value at map start.
resultVar
Returns rate * time + initialValue.
Note.pngNote:The value is not continuous as one might expect, i.e. if the rate is changed dynamically, it will not 'add' to the previous value.

CurrentTime The number of seconds the current map has been running on the server for.

resultVar
This is intended to set the $time shader variable, used by several shaders to adjust their effects over time.

UniformNoise A noisy signal where each value is equally likely to occur.

minVal
maxVal
resultVar
Returns an random value in the range [minVal, maxVal] with equal probability.

GaussianNoise A noisy signal where values are biased towards the average.

mean
The average value around which the noise will centre
halfWidth
The distance from the average at which it's only 30% likely to occur.
minVal
maxVal
resultVar

MatrixRotate A rotation matrix from the provided axis and angle.

axisVar
Axis of rotation, in the format [x y z]
angle
Degrees of rotation around axis.
resultVar
The result of this is a transformation matrix, suitable to set $basetexturetransform and other similar variables.

Entity Data Access

These proxies read values from the entity the proxy is applied to.

Warning.pngWarning:Will cause a crash when used on prop_static, world brushes, infodecal, info_projecteddecal, or unnamed info_overlays. Named info_overlays are fine.

Alpha Copies the entity's renderamt value to the $alpha material parameter.

$alpha
The alpha material variable is set to the value of the entity's renderamt

Cycle Outputs the progress through the current animation of the entity.

start
The value to output at the start of the animation. This can't be a variable reference.
end
The value to output at the end of the animation. This can't be a variable reference.
easein
Apply easing to the beginning of the output. This can't be a variable reference.
easeout
Apply easing to the beginning of the output. This can't be a variable reference.
resultVar
The variable to store the result in.

PlayerProximity Outputs the distance in units between the local player and the origin of the entity that the material is applied to.

scale
A factor by which the result is multiplied.
resultVar

PlayerTeamMatch Returns 1 if the team of the entity the material is applied to matches that of the local player. Used in TF2 for func_respawnroomvisualizer.

resultVar
This value is 1 if the local player is on the same team and 0 if the local player is not.

PlayerView The dot product of the player's view angle and the relative origin of the material's entity.

scale
The value is rescaled to be between 0 and the scale value.
resultVar

PlayerSpeed Speed of the local player.

scale
The value is multiplied by this value. This factor defaults to 0.005.
resultVar

PlayerPosition The local player's position.

scale
The value is multiplied by this value. This factor defaults to 0.005.
resultVar
Set to the vector position.

EntitySpeed The material's entity's speed.

resultVar
The current speed of this entity, in units per second.

EntityOrigin The material's entity's origin. The variable set cannot be changed.

$entityorigin
Set to the origin of the entity.

EntityRandom A static random number associated with the entity the material is applied to. Helpful for staggering effects that appear on multiple objects.

scale
The value is rescaled to be between 0 and the scale value.
resultVar
Icon-Bug.pngBug:Entities using this in Portal will cause a crash the moment that they move through a portal.

Health The material's entity's health (0-1).

scale
The value is rescaled to be between 0 and the scale value.
resultVar
Icon-Bug.pngBug:Does not work in most games. The game maintains a cache of unique keys in KeyValues case-insensitive, while material proxies are internally a case-sensitive lookup. This causes the lookup to fail as a KeyValues file with a lowercase health key defined is parsed (e.g. propdata.txt) before the material. This can be workarounded by adding an uppercase Health key into gameinfo.txt or defining the material proxy lowercase in the client code.

IsNPC Returns whether the material is applied to a NPC. Used in HL2 for npc_hunter's eye glow, which is supposed to stay off on ragdolls.

scale
The value to return when the material is applied to a NPC. Despite the name, nothing in this process is actually multiplied. (although this must be a float)
resultVar
If the material is applied to a NPC, this value is equal to scale. Otherwise, this value stays at 0.

WorldDims The dimensions of the world entity. The variables set cannot be changed.

$world_mins
Set to the minimum X/Y/Z coordinates.
$world_maxs
Set to the maximum X/Y/Z coodinates.

CrosshairColor The color of the local player's crosshair. cl_crosshaircolor_(r, g, b)

resultVar
Returns [r g b] with values from 0 to 1.

Texture manipulation

AnimatedTexture Increments the current frame of an animated VTF.

animatedTextureVar
Texture to increment frame for.
( i.e. $basetexture, $bumpmap, $normalmap, $envmapmask, $detail)
animatedTextureFrameNumVar
Frame variable to increment.
( i.e. $frame, $bumpframe, $envmapmaskframe, $detailframe)
animatedTextureFrameRate
Framerate in frames per second. Fixed; cannot be changed once set.
animationNoWrap
If 1, prevents the animation from looping.

AnimatedEntityTexture Identical to AnimatedTexture, except the entity controls when the animation starts and is "notified" when the animation is wrapped.

animatedTextureVar
animatedTextureFrameNumVar
animatedTextureFrameRate
animationNoWrap

AnimatedOffsetTexture Identical to AnimatedTexture, except the animation begins when the entity it's applied to spawns.

animatedTextureVar
animatedTextureFrameNumVar
animatedTextureFrameRate
animationNoWrap

AnimateSpecificTexture Identical to AnimatedTexture, except only the specified texture could be animated.

animatedTextureVar
animatedTextureFrameNumVar
animatedTextureFrameRate
animationNoWrap
onlyAnimateOnTexture
The full path for the texture that this proxy should function with.
Todo: What is this used for? None out of around 40 thousand official Valve .vmt files use this proxy

Pupil Used for character's eyes, computes the light brightness at the material's position and reacts to bright lights by incrementing the texture's frame.

TextureVar
Texture to increment frame for.
TextureFrameNumVar
Frame variable to increment.
PupilCloseRate
The maximum speed the pupil can close, in fractions/second. The default is 0.1.
PupilOpenRate
The maximum speed the pupil can open, in fractions/second. The default is 0.03.
$lighting
This material variable is used to store the previous frame, and should be set to 0.5 in the material. It will be set to the average light value, from 0-1.

TextureTransform Generates a texture transform matrix for use with $basetexturetransform etc.

centerVar
scaleVar
rotateVar
translateVar
Optional input variables for the matrix. Each one can be a float or a 2D vector.
resultVar

TextureScroll Returns a transform matrix or vector that will translate a texture at a given angle at a given rate.

textureScrollVar
Destination for the resulting transformation.
textureScrollRate
Rate of scroll in units per second.
textureScrollAngle
Angle of rotation to move along. (90 = up, 180 = left, etc)
textureScale
Scale of the texture; defaults to 1.0 if unspecified. Works similarly to the TextureTransform proxy's scaleVar and $basetexturetransform's scale component (e.g., 2.0 is a 50% scale). Unlike those, however, textureScale only accepts a single float—not a 2D vector—so this proxy can't scale a texture's X and Y axes individually.

LampBeam Modulates the material's alpha value based on angle between the beam's direction and the viewer's eye point. This is used to make the beams of volumetric light on lights fade as you look at them dead on. Must be attached to entity for angle use.

LampHalo Modulates the material's alpha value based on angle between the beam's direction and the viewer's eye point. Like the LampBeam proxy, but used for the halo at the beam's base. Must be attached to entity for angle use.

Entity integration

MaterialModify / MaterialModifyAnimated

Used in conjunction with the material_modify_control entity to configure arbitrary parameters from map I/O. Only works when the material is applied to an entity. MaterialModify takes no parameters. MaterialModifyAnimated takes the same parameters as AnimatedTexture.
Note.pngNote:Searches for material_modify_control among children of an entity a material with this proxy is rendered on and then applies its effects.

WaterLOD

Coordinates water LOD values between the map's water_lod_control entity and the material's internal values.
Warning.pngWarning:Both of the parameters MUST be defined in the VMT or the proxy will fail.
$CHEAPWATERSTARTDISTANCE
Start distance for cheap water
Note.pngNote:must be set outside of proxy block.
$CHEAPWATERENDDISTANCE
End distance for cheap water
Note.pngNote:must be set outside of proxy block.

BreakableSurface Sets the base texture to a material name held by the entity (used for switching surface material on shatter). Must be attached to a func_breakable_surf entity.

ConveyorScroll Returns the scroll parameters for a texture used as a conveyor, so it matches the entity's settings. Must be attached to func_conveyor entity.

textureScrollVar
Name of variable to place result in. Must be a matrix or vector type variable (i.e. $baseTextureOffset).

Camo Only used by material Dev\dev_camo.vmt. This generates a texture matching the surroundings, which appears to be intended to be used for Combine Elite at some point. Much of the code is disabled, so this is not usable.

$camopatterntexture
The source texture for the camo effect. Should be I8 format.
$camoboundingboxmin
$camoboundingboxmax
Random points within this bounding box will be sampled to determine the camo coloring.

FleshInterior Outputs the locations of nearby point_flesh_effect_targets for use by the $flesh effect.

$FleshEffectCenterRadius1
$FleshEffectCenterRadius2
$FleshEffectCenterRadius3
$FleshEffectCenterRadius4
Set to the world locations of four flesh targets, with the fourth axis set to the radius. If a target is not present, all four axes are set to zero.
$FleshGlobalOpacity
This material variable has to exist for the proxy to function, but it's not actually set at any point.
$FleshSubsurfaceTint
This is just set to [0 0 0 0].

HeliBlade Controls transition on npc_helicopter's blades. This fades in or out the blades to convert from a set of physical blades into a spinning blurred circle.

$fadeout
If the variable is set to 1, fade out the blades as it starts up. If 0, fade in.
$alpha
This proxy sets the value of the alpha variable.

ParticleSphereProxy Only used by material particle\SmokeStack.vmt. Seems to be defined in particle_proxies.cpp. Valve remark: "FIXME: Is this even needed any more?"

Shadow Only used by Shadow. No known parameters. This sets lots of material parameters to render projected texture shadows.

ShadowModel Only used by ShadowModel. No known parameters. This sets lots of material parameters for rendering projected texture shadows.

Thermal Uses $color vectors and work around $ThermalPeriod, $ThermalMin, and $ThermalMax to generate a Hue scaled Sine and applies back to $color.

$color
Uses $color as ThermalVar internal reference and proxie output.
$ThermalPeriod
Duration to be curl from game's Current Time. Default: 1.0.
$ThermalMin
$ThermalMax
Min/Max values to multiply over sine's by product while prevent go lower than $ThermalMin

ToggleTexture Toggles a texture based on the frame number set by game code (in most games, only via env_texturetoggle). Must be attached to an entity.

toggleTextureVar
Texture to modify based on frames.
toggleTextureFrameNumVar
Variable used for frame number.
toggleShouldWrap
Whether the animation should wrap over not. Enabled by default.
Confirm:Disabling wrapping probably doesn't work correctly if env_texturetoggle's IncrementTextureIndex input is called 256 times due to Wikipedia icon integer overflow.

Utility

Empty Used to comment out proxies. Surround a bunch of proxies with the empty proxy to cause those proxies to not operate.

Dummy Prints developer messages in response to the proxy being created, the proxy being initialized, the proxy being bound to an entity, and the proxy being removed.

Miscellaneous

(in all games since Left 4 Dead)

ConVar Allows you to link a specific variable to a ConVar a client has set.

convar
The ConVar name to link to, e.g. mat_specular.
Note.pngNote:Strings will not be parsed through, the value of the ConVar must be a number.
resultVar
Returns the value of the ConVar. If this is a vector type, all axes will be set individually to the ConVar's value.

Game Specific

Half-Life 2 Half-Life 2


EntityOriginAlyx Identical to EntityOrigin with an x offset of 15. Created as a last-minute hack before The Orange Box shipped.

Ep1IntroVortRefract Uses $refractamount to generate a ratio and sends it to the same variable, not using resultVar. Created as a last-minute hack before The Orange Box shipped.

VortEmissive Sets $emissiveblendstrength and $detailblendfactor to apply the Vortigaunt's blue-purple glow effects in Episode 1's opening.

Shield Likely intended to be used for one of the Combine shield types. This is equivalent to a combination of the TextureScroll and Alpha proxies.

$translucency
This variable is set to the Render Alpha value of the attached entity, similar to the Alpha proxy.
textureScrollVar
textureScrollRate
textureScrollAngle
Has identical functionality to the TextureScroll proxy.

Team Fortress 2 Team Fortress 2


invis Works if $cloakPassEnabled is true. Supports both world models and view models, but doesn't have team color support.

spy_invis Works if $cloakPassEnabled is true. Used in player world model materials. No parameters. Cloak color will be team-colored on players by default. Incompatible with $weapon_invis and $vm_invis.

weapon_invis Works if $cloakPassEnabled is true. Used in weapon world model materials. No parameters. Incompatible with $spy_invis and $vm_invis.

vm_invis Works if $cloakPassEnabled is true. Used in player and weapon view model materials. No parameters. Incompatible with $spy_invis and $weapon_invis.

building_invis Unused, intended to be used in building model materials to support cloaking.

CommunityWeapon Passes the value 1 when item is flagged as a Community quality item. Passes 0 otherwise.

resultVar

InvulnLevel Passes a float value to set the opacity of the invulnerability effect when a player has been ÜberCharged.

resultVar

BurnLevel Passes a float value to set the opacity of the fire overlay effect when a player is on fire.

resultVar

YellowLevel Passes an RGB value when Jarate has been used on a player.

resultVar

ModelGlowColor When active, passes hard coded color value to create the crit glow effect. Color is either red or blue. When inactive value is pure white (255 255 255).

resultVar

ItemTintColor Passes an RGB value when a Paint Can is used. Value is specific to Paint color. Passes 0 when no Paint is used.

resultVar

BuildingRescueLevel Passes a transform matrix to set the amplitude of the Rescue Ranger display.

resultVar

TeamTexture Changes the animation frame of the texture depending on the current team.

resultVar - Only writes to $frame

AnimatedWeaponSheen Performs the killstreak sheen effect.

animatedtexturevar
animatedtextureframenumvar
animatedtextureframerate

WeaponSkin Sets basetexture for Decorated items.

ShieldFalloff Pulses the Vaccinator's Über shield.

StatTrakIllum Returns 0.75 on viewmodels.

resultVar

StatTrakDigit Returns one digit of the item's Strange counter. If trimZeros is positive, leading zeroes will return 10 instead.

resultVar
displayDigit
trimZeros

StatTrakIcon Non-functional. Returns a constant matrix.

resultVar

StickybombGlowColor When active, passes hard coded color value to create the 'Scottish Resistance' selection effect. Color is either red or blue.

resultVar

SniperRifleCharge Returns a transform matrix for the Sniper Rifle charge up. Other weapons can affect the return value such as melee weapons and the Medi Gun

resultVar

Heartbeat Returns a time-varying value between 0.48 and 0.6 (mostly 0.6) to simulate a heartbeat.

resultVar

WheatlyEyeGlow Pulsates a color with Gaussian Distribution. Used for the Ap-Sap item.

resultVar

BenefactorLevel Used for scaling the beating heart based on the number of gifts the player has given. Returns a texture scale factor where 1 is max size (big benefactor) and factor gets larger the fewer gifts you've given.

resultVar

CustomSteamImageOnModel Replaces the $baseTexture with a custom texture. No parameters.

Note.pngNote:This is used to make it possible to use the decal tool on hats in Team Fortress 2, for example.

Left 4 Dead 2 Left 4 Dead 2


PlayerTeam Returns a value depending on the team the player is currently in.

team
Unknown
resultVar
0 = survivor / 1 = infected / 2 = spectator

BloodyHands Returns a value between 0 and 1 depending on the number of hits with a melee weapon.

resultVar
number of hits / 5
doesn't go over 1 after 5 hits
value is shared between world and view model

IT Returns a value between 0 and 1 depending on the fact that the survivor is covered in Boomer bile.

resultVar
1 = fully covered / 0 = not covered

BurnLevel Passes a float value to set the opacity of the fire overlay effect when an infected has been burned.

resultVar
1 = on fire / 0 = not on fire

BBQLevel Seen in materials\models\infected\hulk\hulk_01.vmt

resultVar

Alien Swarm Alien Swarm


NightVisionSelfIllum When the player has a night vision effect or sniper scope active, outputs a strength to modulate selfillumination on objects.

resultVar
The value to change. Generally set to $selfillumtint.
asw_night_vision_self_illum_multiplier
This ConVar specifies the value output when night vision is on at full strength.
asw_sniper_scope_self_illum_multiplier
This ConVar specifies the value output when the sniper scope is active.

AlienSurfaceFX Sets the $detail texture and parameters to display fire, freezing and electrical shock effects.

texturescrollvar
Set to the name of the matrix or transform variable that shifts the detail texture, usually $detailtexturetransform.

LanguagePreference (only in Alien Swarm: Reactive Drop) Sets a value based on the client's language setting.

resultVar
The variable to change. (eg. $basetexture)
default
The default value for the variable if no listed language matches.
english, french, schinese, etc.
Specific values for specific languages.

Portal Portal and Portal 2 Portal 2


PortalOpenAmount On portals, transitions from 0 to 1 as the portal opens.

resultVar

PortalStatic On portals, specifies how much the opaque static effect should render. 1 is a unpaired portal, 0 is an open portal.

resultVar

Portal 2 Portal 2 only


FizzlerVortex Sets various parameters used by the SolidEnergy shader for fizzler effects - the location of nearby objects, flashing from portal shots, and power transition times. Doesn't take any arguments.

$powerup
Transitions to 0 when the fizzler is turned off, 1 when turned on.
$FLOW_VORTEX1
Set to 1 when an object is brought near the field, otherwise set to 0.
$FLOW_VORTEX_POS1
Set to the position of the first object.
$FLOW_VORTEX2
Set to 1 when a second object is brought near the field, otherwise set to 0.
$FLOW_VORTEX_POS2
Set to the position of the second object.
Todo: What parameter does the portal shot flash set?

WheatlyEyeGlow

Presumably controls the glow effect on Wheatley. Not actually used.
Todo: Does this do anything? Seems to have been replaced by Lightedmouth.

Lightedmouth Used on the various Personality Cores and PoTaTOS to blink their eye-light in sync with their choreo scenes. When idle, the tint is still partially lit. On the viewmodel, it can also be manually controlled via VScript to make GLaDOS appear to shut down.

resultVar
A tint to pass to $selfillumtint.

LightedFloorButton Used on the clean Super Button materials, sets $selfillumtint to 1 if the material is being used on a prop_floor_button, otherwise sets it to 0. This has no real benefit and just causes the model to appear incorrectly when used on other entities, it was presumably a beta leftover.

resultVar
The tint to use, or [0 0 0] if not on a button.

TractorBeam Used on the Excursion Funnel effect materials, outputs the scroll rate and does other unknown operations.

resultVar
Passed to the textureScrollRate parameter of various TextureScroll proxies.

Black Mesa Black Mesa

TauCharge Seen in materials/models/weapons/v_gauss/v_taucannon_core.vmt.

resultVar

WebBurnFactorProxy Seen in materials/models/props_xen/gonarch/gon_web_tough_burnable.vmt.

resultVar

ModelDetailFx Seen in materials/models/weapons/v_gauss/v_taucannon_core.vmt.

AnimatedWeaponSheen Seen in materials/models/world_models/w_357_mp.vmt.

Counter-Strike: Global Offensive Counter-Strike: Global Offensive


Select Picks a result value depending on the input value, like a switch statement.

srcVar1
resultVar
default
The default return value if the value of srcVar1 does not match any case.
<case>
The return value if the value of srcVar1 has the value <case>. There can be multiple cases.

Example from materials/models/inventory_items/dogtags/dogtags_lightray.vmt:

"srcVar1"   "$localTeamNumber"
"resultVar" "$color"
"default"   "[0.680 0.680 0.680]"
"2"         "[0.680 0.544 0.136]"
"3"         "[0.269 0.474 0.680]"
Todo: Works for other case types? Other games?

GetTeamNumber Gets the team of an entity. Seen in materials/models/inventory_items/dogtags/dogtags_lightray.vmt.

resultVar
  • 0: Unassigned
  • 1: Spectator
  • 2: Terrorist
  • 3: Counter-Terrorist
Todo: Other games?

survivalteammate Used to paint the teammate in CS:GO Danger Zone Danger Zone. Seen in materials/models/player/custom_player/econ/body/tm_jumpsuit/jumpsuit_body.vmt.

resultVar
Returns 1 if the local player is the teammate of the player that the material is applied to and 0 if not.
Note.pngNote:Always returns 0 outside of Danger Zone — use GetTeamNumber instead!

RemapValClamp Remaps a variable within the specified ranges.

range_in_min
range_in_max
range_out_min
range_out_max
srcVar1
resultVar

Modulo Divides the first variable by the second and writes the remainder value to the resultvar.

srcVar1
srcVar2
resultVar

MoneyProxy Reads from the players money value. Only works on viewmodel materials.

resultVar

WeaponLabelText Calculates where to offset the $basetexture based on the displaydigit value. Only works on the viewmodel.

displaydigit

C4CompassArrow [Todo]

IronSightAmount Returns 1 when the player is scoped in, 0 when scoped out.

invert
resultvar

ApproachValue Performs a smooth transition from the current value of srcVar1 to the targetvalue of srcVar2.

srcVar1
srcVar2
speed
specifies how quickly the transition happens, with a higher value leading to a faster transition.
resultVar
the result of the transition is stored in the resultvar.

Titanfall Titanfall and Titanfall 2 Titanfall 2


ADSFraction Returns a value between 0 and 1, depending on how much the player is adsing.

use_weapon_settings
If set, uses the weapon's zoom_scope_frac_start and zoom_scope_frac_end settings.
startFrac
endFrac
invert
spline
scale
resultVar

ADSFOVTarget [Todo]

range
invert
resultVar

BackgroundAmmoColor Passes an RGB value according to the current clip of the player's weapon. Goes from blue -> orange -> red.

resultVar

ClipAmmo Returns the current clip of the player's current weapon.

resultVar

ClipAmmoColor Similar to BackgroundAmmoColor, but the ammount where the value changes is different.

resultVar

CockpitLights [Todo]

CockpitOpenAmount [Todo]

CockpitScreen [Todo]

EntityScript Calls a Vscript function and returns a value.

scriptFuncName
resultVar

Holosight Similar to ADSFraction, but with seemingly no settings.

resultVar

HoloSightOffset Base offset from UV centre relative to vector2 $attachment position.

attachmentName
horizontalScalar
verticalScalar
resultVar

Example from materials/models/weapons/attachments/hcog_reticle_front.vmt:

"attachmentName"   "HCOG_REAR"
"horizontalScalar" "0.55"
"verticalScalar"   "-0.72"
"resultVar"         "$holoOffset"

MaxCarryAmmo Returns the max reserve ammo size of the player's current weapon.

resultVar
Icon-Bug.pngBug:Doesn't work if the weapon doesn't use clips.  (tested in: Titanfall 2)

MaxClipAmmo Returns the max clip size of the player's current weapon.

resultVar

MiniMap [Todo]

resultVar

NumericCounterAtlasFrame [Todo]

value
digitIndex
resultAtlasFrameIndexVar

ProgressBar [Todo]

value
max
resultVar
The result is a transformation matrix.

RemainingAmmo Returns the current reserve ammo of the player's current weapon.

resultVar
Icon-Bug.pngBug:Doesn't work if the weapon doesn't use clips.  (tested in: Titanfall 2)

RemainingAmmoColor Similar to BackgroundAmmoColor, but uses the weapon's reserve ammo instead.

resultVar
Icon-Bug.pngBug:Doesn't work if the weapon doesn't use clips.  (tested in: Titanfall 2)

RemainingClipCount Returns the max reserve ammo divided by the max clip size of the player's current weapon.

resultVar

ScriptModify Calls a Vscript function and returns a value.

scriptFuncName
resultVar

Example from materials/vgui/hud/compass_ticker.vmt:

"scriptFuncName" "VMTCallback_CompassTickerOffset"
"resultVar" "$offset"
Confirm:Identical to EntityScript?

TextureAtlas [Todo]

frameSize
frameStart
resultVar

TickCounterAtlasFrames [Todo]

tickCount
rowLength
rowIndex
atlasFrameSize
resultAtlasFrameStartVar
resultAtlasFrameCountVar

WeaponChargeFraction Returns a value between 0 and 1, depending on the charge amount of the player's current weapon.

resultVar

See also