Shader Types and Parameters

From Valve Developer Community
Revision as of 17:18, 15 August 2005 by Deathz0rz (talk | contribs) (Shader Types: modified unlitgeneric)

Jump to: navigation, search

Shader Types

Shader Name Description Parameter Notes
alienscale
basetimeslightmaptimesdetail
basetimeslightmapwet
basetimesmod2xenvmap
bloom
blurfilterx
blurfiltery
cable
camo
cloud
debugbumpedlightmap
debugbumpedvertexlit
debugfbtexture
debuglightingonly
debuglightmap
debugluxels
debugmodifyvertex
debugnormalmap
debugunlit
debugvertexlit
decalBaseTimesLightmapAlphaBlendSelfillum
decalmodulate
downsample
eyeball
eyes Used for realistic eyeballs for models.
fillrate
gooinglass Used for realistic glass container, Containing a violent fluid. The alpha channel Of "$basetexture" decides how much basetexture is shown ontop of the bump map. "
internalframesync
jellyfish
jojirium
lightmappedgeneric The most common texture. A basetexture is multiplied by a lightmap.

Only the $basetexture line is required.

lightmappedtwotexture Two textures are mixed evenly and multiplied by a lightmap. Useful if one or both base textures are in motion.
modeladditivetransEnvMapwithMaskedTexture
modulate
overlay_fit
particlesphere
predator
reflecttexture
refract Refracts the light behind it according to a dudvmap and bumpmap. Only works correctly on models. If used on a model, Set "$model" 1
shadow
shadowbuild
shadowmodel
showdestalpha
skyfog
sprite
teeth
translucentlightmap
unlitgeneric A basetexture appears at full brightness. If used on a model, Set "$model" 1
unlittwotexture Two textures are mixed evenly and appear at full brightness.
vertexlitgeneric A basetexture with vertex lighting.
vertexnormals
volumetricfog
water
watersurfacebottom
wireframe
worldtwotextureblend Used for displacements (terrain). Two basetextures are vertex lit. The percentage blend of each of the two textures is defined by alpha painting in Hammer. Use $basetexture2 and $bumpmap2 to define the second material
worldvertexalpha Used for displacements (terrain). A basetexture is vertex lit.
worldvertextransition
yuv

Shader Parameters

Texture References

"$basetexture" "path to base texture"
Basic color map.
"$basetexture2" "path to 2nd base texture"
Used for the WorldVertexTransition shader.
"$bumpmap" "path to normal map"
Defines normal vectors for lighting purposes and for envmap distortion
"$bumpmap2" "path to normal map"
Used for the WorldVertexTransition shader.
"$parallaxmap" "path to height map"
Use for parallax mapping. Not functional.
"$texture2" "path to 2nd base texture"
Used for "twotexture"-type shader.

Texture Adjustment

"$bumpscale" float
"$parallaxmapscale" float

World Interaction

"$surfaceprop" "surface property"
Defines the gib types and impact sounds of the material. See Material Surface properties for more information.

Reflections

"$envmap" "env_cubemap"
Uses nearest env_cubemap for reflection.
"$envmaptint" "[float float float]"
Scales the red, green, and blue components of the envmap.
"$normalmapalphaenvmapmask" 1
Masks the envmap according to the alpha channel of the normal map.

Lighting/Rendering

$additive 1
Renders the texture additively (Its colors are added to, instead of replacing, what is displayed behind it).
"$alpha" float
Scales material opacity by the 'float' number.
"$color" "[float float float]"
Scales red, green, and blue components of the material.
"$nocull" 1
Make the surface two-sided.
"$selfillum" 1
Uses $basetexture's alpha channel to set minumum clamps on the lighting.

Other

"$decal" 1
Needed for a material to be rendered as a decal. See Creating Decals.
"$model" 1
Used on materials applied to models (used with "UnlitGeneric", "Refract" and others).
"$translucent" 1
used with "UnlitGeneric" "VertexlitGeneric" "LightmappedGeneric" and many more shaders to enable a oppacity map according to the alpha channel of the "$basetexture".
"$writeZ" 1
Only used by materials using the modulation shader. Setting $writeZ to 1 forces the material to set the z value in the depth buffer (so things z-buffer against it). By default, the modulation shader doesn't set the z value.

See also

Creating Materials