List of material proxies: Difference between revisions
Jump to navigation
Jump to search
Note:must be a matrix or vector type variable (i.e.
TomEdwards (talk | contribs) |
TomEdwards (talk | contribs) (cleanup) |
||
Line 1: | Line 1: | ||
== Calculation == | == Calculation == | ||
<div style="-moz-column-count:2;"> | <div style="-moz-column-count:2;-webkit-column-count:2;column-count:2;"> | ||
; <code>Add</code> | ; <code>Add</code> | ||
: ''Adds two variables.'' | : ''Adds two variables.'' | ||
Line 53: | Line 53: | ||
== Number generation == | == Number generation == | ||
<div style="-moz-column-count:2;"> | <div style="-moz-column-count:2;-webkit-column-count:2;column-count:2;"> | ||
; <code>Sine</code> | ; <code>Sine</code> | ||
: | : ''A [[w:sine wave|sine wave]].'' | ||
:; <code>sineperiod</code> | :; <code>sineperiod</code> | ||
:: Period | :: Period between wave peaks, in seconds. | ||
:; <code>sinemin</code> | :; <code>sinemin</code> | ||
:; <code>sinemax</code> | :; <code>sinemax</code> | ||
:: | :: Values at the top and bottom of the wave | ||
:; <code>timeoffset</code> | :; <code>timeoffset</code> | ||
:: Used to | :: Used to offset the starting position of the wave | ||
:; <code>resultVar</code> | :; <code>resultVar</code> | ||
; <code>LinearRamp</code> | ; <code>LinearRamp</code> | ||
: | : ''An ever-increasing [[float]] value.'' | ||
:; <code>rate</code> | :; <code>rate</code> | ||
:: | :: Units per {{confirm|second}}. | ||
:; <code>initialValue</code> | :; <code>initialValue</code> | ||
:; <code>resultVar</code> | :; <code>resultVar</code> | ||
:: | ; <code>CurrentTime</code> | ||
: ''The number of seconds the current map has been running on the server for.'' | |||
:; <code>resultVar</code> | |||
; <code>Exponential</code> | ; <code>Exponential</code> | ||
: | : ''A value that [[Wikipedia:Exponential function|changes at a faster and faster rate]].'' | ||
:; <code>srcVar1</code> | :; <code>srcVar1</code> | ||
:: | :: The exponent with which to calculate | ||
:; <code>offset</code> | :; <code>offset</code> | ||
:: Offset for | :: Offset for exponent | ||
:; <code>minVal</code> | :; <code>minVal</code> | ||
:; <code>maxVal</code> | :; <code>maxVal</code> | ||
:: Upper and lower value clamps | :: Upper and lower value clamps | ||
:; <code>scale</code> | |||
:; <code>resultVar</code> | :; <code>resultVar</code> | ||
:: | :: scale * exp( srcVar1 + offset ) {{tip|1=exp(5) = 148.413159}} | ||
; <code>UniformNoise</code> | ; <code>UniformNoise</code> | ||
: | : ''A noisy signal where each value is equally likely to occur.'' | ||
:; <code>minVal</code> | :; <code>minVal</code> | ||
:; <code>maxVal</code> | :; <code>maxVal</code> | ||
:; <code>resultVar</code> | :; <code>resultVar</code> | ||
; <code>GaussianNoise</code> | ; <code>GaussianNoise</code> | ||
: | : ''A noisy signal where values are biased towards the average.'' | ||
:; <code>mean</code> | :; <code>mean</code> | ||
:: The average | :: The average value around which the noise will centre | ||
:; <code>halfWidth</code> | :; <code>halfWidth</code> | ||
:: The distance from the average at which it's only 30% likely to occur. | :: The distance from the average at which it's only 30% likely to occur. {{todo|WTF?}} | ||
:; <code>minVal</code> | :; <code>minVal</code> | ||
:; <code>maxVal</code> | :; <code>maxVal</code> | ||
:; <code>resultVar</code> | :; <code>resultVar</code> | ||
; <code>MatrixRotate</code> | ; <code>MatrixRotate</code> | ||
: | : ''A [[rotation matrix]] from the provided axis and angle.'' | ||
:; <code>axisVar</code> | :; <code>axisVar</code> | ||
:: Axis of rotation | :: Axis of rotation, in the format <code>[x y z]</code> | ||
:; <code>angle</code> | :; <code>angle</code> | ||
:: Degrees of rotation around axis. | :: Degrees of rotation around axis. | ||
:; <code>resultVar</code> | :; <code>resultVar</code> | ||
:: | :: {{todo|Output format}} | ||
; <code>PlayerProximity</code> | ; <code>PlayerProximity</code> | ||
: | : ''The distance between the entity the material is applied to and the local player.'' | ||
:; <code>scale</code> | :; <code>scale</code> | ||
:; <code>resultVar</code> | :; <code>resultVar</code> | ||
; <code>PlayerView</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>scale</code> | ||
:; <code>resultVar</code> | :; <code>resultVar</code> | ||
; <code>PlayerSpeed</code> | ; <code>PlayerSpeed</code> | ||
: | : ''Speed of the local player.'' | ||
:; <code>scale</code> | :; <code>scale</code> | ||
:; <code>resultVar</code> | :; <code>resultVar</code> | ||
; <code>PlayerPosition</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>scale</code> | ||
:; <code>resultVar</code> | :; <code>resultVar</code> | ||
; <code>EntitySpeed</code> | ; <code>EntitySpeed</code> | ||
: | : ''The material's entity's speed.'' | ||
:; <code>scale</code> | :; <code>scale</code> | ||
:; <code>resultVar</code> | :; <code>resultVar</code> | ||
; <code>EntityRandom</code> | ; <code>EntityRandom</code> | ||
: A | : ''A random number associated with the entity the material is applied to. Helpful for staggering effects that appear on multiple objects.'' | ||
:; <code>scale</code> | :; <code>scale</code> | ||
:; <code>resultVar</code> | :; <code>resultVar</code> | ||
</div> | </div> | ||
== Texture manipulation == | == Texture manipulation == | ||
<div style="-moz-column-count:2;"> | <div style="-moz-column-count:2;-webkit-column-count:2;column-count:2;"> | ||
; <code>TextureTransform</code> | ; <code>TextureTransform</code> | ||
: Generates a texture transform matrix. | : Generates a texture transform matrix. | ||
Line 220: | Line 189: | ||
== Entity integration == | == Entity integration == | ||
<div style="-moz-column-count:2;"> | <div style="-moz-column-count:2;-webkit-column-count:2;column-count:2;"> | ||
; <code>MaterialModify</code> | ; <code>MaterialModify</code> | ||
: 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.}} | : 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.}} |
Revision as of 12:23, 6 May 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.
Tip:frac(4.23) = .23
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. Todo: WTF?
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 random number associated with the entity the material is applied to. Helpful for staggering effects that appear on multiple objects.
scale
resultVar
Texture manipulation
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.
Empty
- Used to comment out proxies. Surround a bunch of proxies with the empty proxy to cause those proxies to not operate.
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.
Note: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.
Note: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.
Note:Must be attached to entity for angle use.
- No return value.
AnimatedTexture
- 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
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.
Entity integration
MaterialModify
- 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.
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)
Note:Must be attached to a
func_breakablesurface
entity. ConveyorScroll
- Returns the scroll parameters for a texture used as a conveyor.
Note:Must be attached to
func_conveyor
entity.textureScrollVar
- Name of variable to place result in.

$baseTextureOffset
).Camo
Note:Only used by material "Dev\dev_camo.vmt".
camopatterntexture
- [Todo]
camoboundingboxmin
- [Todo]
camoboundingboxmax
- [Todo]
surfaceprop
HeliBlade
- [Todo]
ParticleSphereProxy
- Seems to be defined in
Note:Only used by material "particle\SmokeStack.vmt".
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.