VertexLitGeneric
VertexLitGeneric
is a vertex shader available in all Source games. It is the shader most commonly used to render models, and supports a variety of effects. Do not use this on world geometry, else you may encounter lighting bugs.
Contents
Supported Parameters
Basics
$basetexture defines albedo texture.
Use a 2nd UV channel for high-resolution decal support.
Adjustment
Transform $basetexture's alignment, scale, rotation and position.
Prevents the model's material from being tinted by $color2 or
rendercolor.
Todo: Confirm use of texcoord1 for detail texture
Use the base alpha to desaturate the base texture. Set to non-zero to enable, value gets multiplied into the alpha channel before desaturating.
Transparency
VertexLitGeneric support a few different methods for transparency, each for different purposes
$alphatest is a Cheap transparency using a binary opacity mask.
$translucent is a expensive translucency using a full Alpha mask, for very fine gradients.
Note:Add material sorting issues
$additive alike $translucent perform full Alpha mask, however it add colors instead of performing a multiplication. This renders in a always brighter material.
$distancealpha is a vector-like edge filtering.
Lighting
1 dimension Per-texel color modification via a warp texture.
Use Half-lambertian shading.
Determines whether the surface is self-illuminated independent of environment lighting.
Pre-baked lightmap; subject to limitations.
Reflection
Effect
Wrinklemaps for character faces.
Wrinklemaps for character faces.
Vertex manipulation to give the effect of trees swaying in the wind.
Technical Workarounds
Tell projected textures such as the flashlight to ignore the surface normal of the model. Useful for models with
$nocull
such as foilage. Otherwise, lighting the face with a flashlight from behind will not affect it. Default 0.Force low quality flashlight/projected texture shadows for faster performance.
Fence render hack for cascade shadow maps, allows shadow maps to work properly with fences.
Disable cascade shadow map lookup/filtering, useful on dense foilage.
Allows turning off the shadow pass of this material.
No deferred light input.
Use global light direction as normal for all model vertices.
Cloak
VertexLitGeneric
natively supports the Spy cloak effect from Team Fortress 2 . Combine it with a sine wave proxy for the full effect.
Enables cloaking effects.
Warning:Enabling this on static props causes a heavy performance penalty, even if the cloak effect itself isn't being used!
0.00 = fully visible,
1.00 = fully invisible.
1.00 = fully invisible.
Colors the refraction effect. Default " [ 1 1 1 ] ".
How strong the refraction effect should be when the material is partially cloaked. Default 2.
Caveats
Mapbase
VertexLitGeneric materials in Mapbase should have the shader SDK_VertexLitGeneric
.
See also
- Materials for models
EyeRefract
, the shader for modeled eyes.Teeth
, the shader for modeled teeth.