List of material proxies

From Valve Developer Community
Revision as of 15:51, 30 December 2009 by Velvetfistironglove (talk | contribs) (Corrected angle examples on TextureScroll)
Jump to navigation Jump to search

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.pngTip:frac(4.23) = .23
srcVar1
resultVar
Clamp
Keeps a variable within a specified range.
min
max
The acceptable range of values
srcVar1
resultVar
LessOrEqual
Tests the relationship between two numeric variables.
lessEqualVar
Variable to copy into resultVar if (srcVar1 <= srcVar2)
greaterVar
Variable to copy into resultVar if (srcVar1 > srcVar2)
srcVar1
srcVar2
resultVar

Number generation

Sine
Creates a sine wave.
sineperiod
Period of the sine wave in seconds.
sinemin
Minimum value of the sine wave.
sinemax
Maximum value of the sine wave.
timeoffset
Used to start the sine wave at a different point in time
resultVar
Resulting value.
LinearRamp
Produces an ever increasing value.
rate
Rate of increase of the value.
initialValue
Initial value to increase.
resultVar
Resulting value.
Exponential
Returns a value that changes at a faster and faster rate. See Wikipedia:Exponential function.
srcVar1
Input variable
offset
Offset for srcVar
scale
Scales the result
minVal
maxVal
Upper and lower value clamps
resultVar
= scale * exp( srcVar1 + offset ) Tip.pngTip:
UniformNoise
Produces a noisy signal where each value is equally likely to occur
minVal
Minimum value range.
maxVal
Maximum value range.
resultVar
Resulting value.
GaussianNoise
Produces a noisy signal where values are near the average.
mean
The average random value.
halfWidth
The distance from the average at which it's only 30% likely to occur.
minVal
Minimum value range (clamped).
maxVal
Maximum value range (clamped).
resultVar
Resulting value.
MatrixRotate
Creates a rotation matrix from the provided axis and angle.
axisVar
Axis of rotation (x,y,z) = (0,1,2).
angle
Degrees of rotation around axis.
resultVar
Rotation matrix.
PlayerProximity
Stores the distance from the entity the material is on to the player into a variable.
Note.pngNote:Does not work on world surfaces.
scale
An amount to scale the distance by.
resultVar
Resulting value.
PlayerView
Stores the dot product of the view direction + the direction from the camera to the entity the material is on.
Note.pngNote:Does not work on world surfaces.
scale
Amount to scale the dot product by.
resultVar
Resulting value.
PlayerSpeed
Stores the speed of the player into a variable.
scale
Amount to scale the speed by.
resultVar
Resulting value.
PlayerPosition
Stores the player's position into a variable.
Note.pngNote:Only works for vector variables like $baseTextureOffset or $color.
scale
An amount to scale the position by.
resultVar
Resulting value.
EntitySpeed
Stores the entity's speed into a variable.
Note.pngNote:Does not work on world surfaces.
scale
An amount to scale the speed by.
resultVar
Resulting value.
EntityRandom
A proxy that returns a random number associated with the entity the material is applied to. Can be helpful for making animated textures not all be in sync.
scale
Amount to scale the random number by.
resultVar
Resulting value.
CurrentTime
Returns the current time as a float.
resultVar
The current time.
PlayerHealth
Stores the player health (0-1) in a variable.
Icon-Bug.pngBug:This doesn't appear to work, unfortunately  [todo tested in ?]
scale
Amount to scale the health value by.
resultVar
Resulting value.
PlayerDamageTime
Stores the time since the player was last damaged, in a variable.
scale
Amount to scale the time by.
resultVar
Resulting value.

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.pngNote: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.pngNote: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.pngNote:Must be attached to entity for angle use.
No return value.
AnimatedTexture
Increments frame variable
Note.pngNote: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.pngNote: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.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)
Note.pngNote:Must be attached to a func_breakablesurface entity.
ConveyorScroll
Returns the scroll parameters for a texture used as a conveyor.
Note.pngNote:Must be attached to func_conveyor entity.
textureScrollVar
Name of variable to place result in.
Note.pngNote:must be a matrix or vector type variable (i.e. $baseTextureOffset).
Camo
Note.pngNote:Only used by material "Dev\dev_camo.vmt".
camopatterntexture
[Todo]
camoboundingboxmin
[Todo]
camoboundingboxmax
[Todo]
surfaceprop
HeliBlade
[Todo]
ParticleSphereProxy
Note.pngNote: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.

See also