List of material proxies: Difference between revisions
TomEdwards (talk | contribs) |
TomEdwards (talk | contribs) (improved layout: 2D flow, templated for consistency) |
||
Line 1: | Line 1: | ||
== Calculation == | == Calculation == | ||
{{MatProxyCell|title=Add|desc=Adds two variables.|arguments= | |||
; <code>srcVar1</code> | |||
; <code>srcVar2</code> | |||
; <code>resultVar</code> | |||
}} | |||
{{MatProxyCell|title=Multiply|desc=Multiplies two variables.|arguments= | |||
; <code>srcVar1</code> | |||
; <code>srcVar2</code> | |||
; <code>resultVar</code> | |||
}} | |||
{{MatProxyCell|title=Subtract|desc=Subtracts the second variable from the first.|arguments= | |||
; <code>srcVar1</code> | |||
; <code>srcVar2</code> | |||
; <code>resultVar</code> | |||
}} | |||
{{MatProxyCell|title=Divide|desc=Divides the first variable by the second.|arguments= | |||
; <code>srcVar1</code> | |||
; <code>srcVar2</code> | |||
; <code>resultVar</code> | |||
}} | |||
{{MatProxyCell|title=Equals|desc=Copies the value of a variable to another.|arguments= | |||
; <code>srcVar1</code> | |||
; <code>resultVar</code> | |||
}} | |||
{{MatProxyCell|title=Abs|desc=Computes the absolute (i.e. [[unsigned]]) value of a variable.|arguments= | |||
; <code>srcVar1</code> | |||
; <code>resultVar</code> | |||
}} | |||
{{MatProxyCell|title=Frac|desc=Returns the fractional component of a variable.'' {{tip|frac(4.23) <nowiki>=</nowiki> .23}}|arguments= | |||
; <code>srcVar1</code> | |||
; <code>resultVar</code> | |||
}} | |||
{{MatProxyCell|title=Clamp|desc=Keeps a variable within a specified range.|arguments= | |||
; <code>min</code> | |||
; <code>max</code> | |||
; <code>srcVar1</code> | |||
; <code>resultVar</code> | |||
: srcVar1 and resultVar can be the same. | |||
}} | |||
{{MatProxyCell|title=LessOrEqual|desc=Compares the first value to the second.|arguments= | |||
; <code>lessEqualVar</code> | |||
; <code>greaterVar</code> | |||
: Variable to copy to <code>resultVar</code> if this condition is met. | |||
; <code>srcVar1</code> | |||
; <code>srcVar2</code> | |||
; <code>resultVar</code> | |||
}} | |||
== Number generation == | == Number generation == | ||
{{MatProxyCell|title=Sine|desc=A [[w:sine wave|sine wave]].|arguments= | |||
; <code>sineperiod</code> | |||
: Period between wave peaks, in seconds. | |||
; <code>sinemin</code> | |||
; <code>sinemax</code> | |||
: Values at the top and bottom of the wave | |||
; <code>timeoffset</code> | |||
: Used to offset the starting position of the wave | |||
; <code>resultVar</code> | |||
}} | |||
{{MatProxyCell|title=LinearRamp|desc=An ever-increasing [[float]] value.|arguments= | |||
; <code>rate</code> | |||
: Units per {{confirm|second}}. | |||
; <code>initialValue</code> | |||
; <code>resultVar</code> | |||
}} | |||
{{MatProxyCell|title=CurrentTime|desc=The number of seconds the current map has been running on the server for.|arguments= | |||
; <code>resultVar</code> | |||
}} | |||
{{MatProxyCell|title=Exponential|desc=A value that [[Wikipedia:Exponential function|changes at a faster and faster rate]].|arguments= | |||
; <code>srcVar1</code> | |||
: The exponent with which to calculate | |||
; <code>offset</code> | |||
: Offset for exponent | |||
; <code>minVal</code> | |||
; <code>maxVal</code> | |||
: Upper and lower value clamps | |||
; <code>scale</code> | |||
; <code>resultVar</code> | |||
: scale * exp( srcVar1 + offset ) {{tip|1=exp(5) = 148.413159}} | |||
}} | |||
{{MatProxyCell|title=UniformNoise|desc=A noisy signal where each value is equally likely to occur.|arguments= | |||
; <code>minVal</code> | |||
; <code>maxVal</code> | |||
; <code>resultVar</code> | |||
}} | |||
{{MatProxyCell|title=GaussianNoise|desc=A noisy signal where values are biased towards the average.|arguments= | |||
; <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. | |||
; <code>minVal</code> | |||
; <code>maxVal</code> | |||
; <code>resultVar</code> | |||
}} | |||
{{MatProxyCell|title=MatrixRotate|desc=A [[rotation matrix]] from the provided axis and angle.|arguments= | |||
; <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}} | |||
}} | |||
{{MatProxyCell|title=PlayerProximity|desc=The distance between the entity the material is applied to and the local player.|arguments= | |||
; <code>scale</code> | |||
; <code>resultVar</code> | |||
}} | |||
{{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> | |||
; <code>resultVar</code> | |||
}} | |||
{{MatProxyCell|title=PlayerSpeed|desc=Speed of the local player.|arguments= | |||
; <code>scale</code> | |||
; <code>resultVar</code> | |||
}} | |||
{{MatProxyCell|title=PlayerPosition|desc=The local player's position.|arguments= | |||
; <code>scale</code> | |||
; <code>resultVar</code> | |||
: = <code>[x y z]</code> | |||
}} | |||
{{MatProxyCell|title=PlayerDamageTime|desc=The number of seconds since the local player was last damaged.|arguments= | |||
; <code>scale</code> | |||
; <code>resultVar</code> | |||
}} | |||
{{MatProxyCell|title=EntitySpeed|desc=The material's entity's speed.|arguments= | |||
; <code>scale</code> | |||
; <code>resultVar</code> | |||
}} | |||
{{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>scale</code> | |||
; <code>resultVar</code> | |||
}} | |||
== Texture manipulation == | == Texture manipulation == | ||
{{MatProxyCell|title=AnimatedTexture|desc=Increments frame variable|arguments= | |||
; <code>animatedtexturevar</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> | |||
: Frame variable to increment (i.e. <code>$frame</code>, <code>$bumpframe</code>) | |||
; <code>animatedtextureframerate</code> | |||
: Framerate in frames per second. Fixed; cannot be changed once set. | |||
}} | |||
{{MatProxyCell|title=TextureTransform|desc=Generates a texture transform matrix.|arguments= | |||
; <code>centerVar</code> | |||
: Name of a variable holding the center of rotation and scaling. [Optional] | |||
; <code>scaleVar</code> | |||
: Name of scale variable (2D vector). [Optional] | |||
; <code>rotateVar</code> | |||
: Name of rotation angle variable (float). [Optional] | |||
; <code>translateVar</code> | |||
: Name of the translation variable (2D vector). | |||
; <code>resultVar</code> | |||
: Resulting value. | |||
}} | |||
{{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) | |||
}} | |||
{{MatProxyCell|title=ToggleTexture|desc=Toggles a texture based on the frame number set by the attached entity. 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. | |||
}} | |||
{{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. | |||
}} | |||
== Entity integration == | |||
{{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. No parameters.'' | |||
}} | |||
{{MatProxyCell|title=WaterLOD|desc=Coordinates water LOD values between the map's [[env_waterlod]] entity and the material's internal values.|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_breakablesurface]]</code> entity. | |||
}} | |||
{{MatProxyCell|title=ConveyorScroll|desc=Returns the scroll parameters for a texture used as a conveyor. 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 "Dev\dev_camo.vmt".|arguments= | |||
; <code>camopatterntexture</code> | |||
: {{todo}} | |||
; <code>camoboundingboxmin</code> | |||
: {{todo}} | |||
; <code>camoboundingboxmax</code> | |||
: {{todo}} | |||
; <code>surfaceprop</code> | |||
}} | |||
{{MatProxyCell|title=HeliBlade|desc={{todo}} | |||
}} | |||
{{MatProxyCell|title=ParticleSphereProxy|desc=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?" | |||
}} | |||
{{MatProxyCell|title=Shadow|desc=Only used by material decals\rendershadow.vmt. No known parameters. | |||
}} | |||
{{MatProxyCell|title=ShadowModel|desc=Only used by material decals\rendermodelshadow.vmt. No known parameters. | |||
}} | |||
== | == 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. | |||
}} | |||
== See also == | == See also == |
Revision as of 04:58, 6 December 2010
Calculation
Add Adds two variables.
srcVar1
srcVar2
resultVar
Multiply Multiplies two variables.
srcVar1
srcVar2
resultVar
Subtract Subtracts the second variable from the first.
srcVar1
srcVar2
resultVar
Divide Divides the first variable by the second.
srcVar1
srcVar2
resultVar
Equals Copies the value of a variable to another.
srcVar1
resultVar
Abs Computes the absolute (i.e. unsigned) value of a variable.
srcVar1
resultVar
Frac
Returns the fractional component of a variable.
srcVar1
resultVar
Clamp Keeps a variable within a specified range.
min
max
srcVar1
resultVar
- srcVar1 and resultVar can be the same.
LessOrEqual Compares the first value to the second.
lessEqualVar
greaterVar
- Variable to copy to
resultVar
if this condition is met. srcVar1
srcVar2
resultVar
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
LinearRamp An ever-increasing float value.
rate
- Units per .
Confirm:second
initialValue
resultVar
CurrentTime The number of seconds the current map has been running on the server for.
resultVar
Exponential A value that changes at a faster and faster rate.
srcVar1
- The exponent with which to calculate
offset
- Offset for exponent
minVal
maxVal
- Upper and lower value clamps
scale
resultVar
- scale * exp( srcVar1 + offset )
Tip:exp(5) = 148.413159
UniformNoise A noisy signal where each value is equally likely to occur.
minVal
maxVal
resultVar
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
- Todo: Output format
PlayerProximity The distance between the entity the material is applied to and the local player.
scale
resultVar
PlayerView The dot product of the player's view angle and the relative origin of the material's entity.
scale
resultVar
PlayerSpeed Speed of the local player.
scale
resultVar
PlayerPosition The local player's position.
scale
resultVar
- =
[x y z]
PlayerDamageTime The number of seconds since the local player was last damaged.
scale
resultVar
EntitySpeed The material's entity's speed.
scale
resultVar
EntityRandom A static random number associated with the entity the material is applied to. Helpful for staggering effects that appear on multiple objects.
scale
resultVar
Texture manipulation
AnimatedTexture Increments frame variable
animatedtexturevar
- Texture to increment frame for (i.e.
$basetexture
,$bumpmap
,$normalmap
(both$bumpmap
and$normalmap
use$bumpframe
)) animatedtextureframenumvar
- Frame variable to increment (i.e.
$frame
,$bumpframe
) animatedtextureframerate
- Framerate in frames per second. Fixed; cannot be changed once set.
TextureTransform Generates a texture transform matrix.
centerVar
- Name of a variable holding the center of rotation and scaling. [Optional]
scaleVar
- Name of scale variable (2D vector). [Optional]
rotateVar
- Name of rotation angle variable (float). [Optional]
translateVar
- Name of the translation variable (2D vector).
resultVar
- Resulting value.
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)
ToggleTexture Toggles a texture based on the frame number set by the attached entity. 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.
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. No parameters.
WaterLOD Coordinates water LOD values between the map's env_waterlod entity and the material's internal values.
$CHEAPWATERSTARTDISTANCE
- Start distance for cheap water
Note:must be set outside of proxy block.
$CHEAPWATERENDDISTANCE
- End distance for cheap water
Note: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_breakablesurface
entity.
ConveyorScroll
Returns the scroll parameters for a texture used as a conveyor. 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".
camopatterntexture
- [Todo]
camoboundingboxmin
- [Todo]
camoboundingboxmax
- [Todo]
surfaceprop
HeliBlade [Todo]
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 material decals\rendershadow.vmt. No known parameters.
ShadowModel Only used by material decals\rendermodelshadow.vmt. No known parameters.
Utility
Empty Used to comment out proxies. Surround a bunch of proxies with the empty proxy to cause those proxies to not operate.