Shadertype¶
New shadertypes .stype files - New shader templates that are applied to textures based on naming conventions (e.g. glass@lightbulb_off.dds applies the glass stype)
Location¶
Depending on the usecase, shadertypes are placed on different locations.
For 2D images (hud, menus, etc.), they are placed in
shadertypes/2dFor map textures, they are placed in
shadertypes/worldFor xmodel textures, they are placed in
shadertypes/model
Format¶
{
// Global shader parameters
parameter value
// Stage 1
{
map $texturename
// Stage-specific parameters
}
// Stage 2 (optional)
{
map textures/my_overlay
// Stage-specific parameters
}
}
Complete Stype Reference¶
2D Shadertypes¶
For HUD, menu, and UI elements
Name |
Description |
|---|---|
|
Cursor hint/indicator with alpha blending |
|
Warning indicator with blend |
|
HUD elements with vertex alpha and RGB |
|
Head/player icons in HUD |
|
Menu background and elements |
World Shadertypes¶
For map/world textures
Name |
Description |
|---|---|
|
Alpha-based shadow casting with lightmap |
|
Asphalt/road surface |
|
Asphalt with X-axis clamping |
|
Asphalt with Y-axis clamping |
|
Billboarded masked sprites |
|
Brick wall material |
|
Brick with X-axis clamping |
|
Brick with Y-axis clamping |
|
Carpet/fabric surface |
|
Cloth material for world objects |
|
Blended cloth material |
|
Light-emitting cloth |
|
Masked/alpha cloth |
|
Concrete surface |
|
Standard decal with lightmap |
|
Asphalt-specific decal |
|
Clamped decal |
|
Decal with X-axis clamping |
|
Decal with Y-axis clamping |
|
Decal with depth writing |
|
Metal decal without alpha mask |
|
Solid decal with Y clamping |
|
Dirt/soil surface |
|
Dirt with X-axis clamping |
|
Dirt with Y-axis clamping |
|
Foliage with alpha testing |
|
Blended foliage |
|
Foliage with clamping |
|
Foliage with X-axis clamping |
|
Foliage with Y-axis clamping |
|
Masked foliage with lightmap |
|
Snow-covered foliage |
|
Standard glass with lightmap |
|
Glass with inner blending |
|
Glass with outer blending |
|
Light-emitting glass |
|
Masked glass |
|
Opaque glass (blocks vision) |
|
Gravel surface |
|
Gravel with Y-axis clamping |
|
Grass with lightmap |
|
Grass with X-axis clamping |
|
Grass with Y-axis clamping |
|
Ice surface |
|
Masked ice |
|
Standard metal surface |
|
Metal without culling |
|
Metal decal |
|
Metal fence/grille (transparent) |
|
Non-solid metal fence |
|
Masked metal with alpha |
|
Solid masked metal |
|
Objective-specific metal |
|
Mud surface |
|
Paper material |
|
Plaster/wall material |
|
Rock surface |
|
Rock with X-axis clamping |
|
Rock with Y-axis clamping |
|
Sand surface |
|
Snow surface |
|
Snow with clamping |
|
Snow with X-axis clamping |
|
Snow with Y-axis clamping |
|
Water surface |
|
Wood material |
|
Wood with X-axis clamping |
|
Wood with Y-axis clamping |
|
Masked wood |
Model Shadertypes¶
For xmodel (3D model) textures
Name |
Description |
|---|---|
|
Character body/flesh |
|
Brick texture |
|
Cloth material |
|
Blended cloth |
|
Cloth with inner blending |
|
Cloth with outer blending |
|
Light-emitting cloth |
|
Masked cloth |
|
Concrete |
|
Decal |
|
Dirt |
|
Flesh/skin material |
|
Masked flesh |
|
Glass |
|
Glass with inner blending |
|
Glass with outer blending |
|
Broken glass with outer blending |
|
Light-emitting glass |
|
Masked glass |
|
Grass |
|
Ice |
|
Metal |
|
Environment-mapped metal |
|
Masked metal |
|
Mud |
|
No-fog glass with outer blending |
|
Glowing objective marker (animated) |
|
Incomplete objective marker (animated) |
|
Masked incomplete objective |
|
Masked objective |
|
Paper |
|
Glowing pickup item (animated) |
|
Masked pickup item |
|
Rock |
|
Sand |
|
Snow |
|
Tank tread metal |
|
Masked tank tread metal |
|
First-person hands |
|
First-person weapon/model |
|
Wheel/tire metal |
|
Masked wheel metal |
|
Wood |
|
Environment-mapped wood (wet look) |
|
Masked wood |
Common Shadertype Patterns¶
Examples of common shadertype patterns from the game files, organized by category.
Basic Material Shadertypes¶
Simple glass (model)¶
{
surfaceparm glass
{
map $texturename
rgbGen lightingDiffuse
}
}
Simple metal (model)¶
{
surfaceparm metal
{
map $texturename
rgbGen lightingDiffuse
}
}
Simple wood (model)¶
{
surfaceparm wood
{
map $texturename
rgbGen lightingDiffuse
}
}
Simple cloth (model)¶
{
surfaceparm cloth
{
map $texturename
rgbGen lightingDiffuse
}
}
Simple water (model)¶
{
surfaceparm water
{
map $texturename
rgbGen lightingDiffuse
}
}
Simple snow (model)¶
{
surfaceparm snow
{
map $texturename
rgbGen lightingDiffuse
}
}
World Surface Shadertypes¶
World glass with lightmap¶
{
surfaceparm glass
{
map $texturename
rgbGen exactVertex
}
{
map $lightmap
blendFunc filter
}
}
World concrete with lightmap¶
{
surfaceparm concrete
{
map $texturename
rgbGen exactVertex
nextbundle
map $lightmap
}
}
World grass with lightmap¶
{
surfaceparm grass
{
map $texturename
rgbGen exactVertex
}
{
map $lightmap
blendFunc filter
}
}
World foliage with alpha and lightmap¶
{
surfaceparm foliage
surfaceparm nomarks
{
map $texturename
rgbGen exactVertex
alphaFunc GE128
depthWrite
nextbundle
map $lightmap
}
}
Opaque glass (no sight, for special glass)¶
{
surfaceparm opaqueglass
{
map $texturename
rgbGen exactVertex
}
{
map $lightmap
blendFunc filter
}
}
2D/UI Shadertypes¶
HUD elements¶
{
nopicmip
nomipmaps
{
map clamp $texturename
blendFunc blend
alphaGen vertex
rgbGen vertex
}
}
Cursor hint¶
{
nopicmip
nomipmaps
{
map clamp $texturename
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
rgbGen vertex
}
}
Warning indicator¶
{
nopicmip
nomipmaps
{
map $texturename
blendFunc blend
}
}
Head icon (HUD)¶
{
nopicmip
nomipmaps
{
map clamp $texturename
blendFunc blend
rgbGen vertex
}
}
Transparent Material Shadertypes¶
Glass with blend in (model)¶
{
surfaceparm glass
sort innerBlend
nomipmaps
nopicmip
{
map $texturename
rgbGen lightingDiffuse
blendFunc blend
}
}
Glass with blend out (model)¶
{
surfaceparm glass
sort outerBlend
nomipmaps
nopicmip
{
map $texturename
rgbGen lightingDiffuse
blendFunc blend
}
}
No-fog glass blend out (model - for special effects)¶
{
surfaceparm glass
sort outerBlend
nofog
nomipmaps
nopicmip
{
map $texturename
rgbGen lightingDiffuse
blendFunc blend
}
}
Glass with light emission (model)¶
{
surfaceparm glass
surfaceparm noshadow
{
map $texturename
rgbGen identityLighting
}
}
World glass with transparency and lightmap¶
{
surfaceparm glass
surfaceparm trans
sort innerBlend
{
map $texturename
rgbGen exactVertex
blendfunc blend
nextbundle
map $lightmap
}
}
World glass blend out¶
{
surfaceparm glass
surfaceparm trans
sort outerBlend
{
map $texturename
rgbGen exactVertex
blendFunc blend
nextbundle
map $lightmap
}
}
Masked/Alpha Materials¶
Foliage masked (world)¶
{
surfaceparm foliage
surfaceparm trans
surfaceparm alphashadow
surfaceparm nomarks
{
map $texturename
rgbGen exactVertex
alphaFunc GE128
depthWrite
nextbundle
map $lightmap
}
}
Foliage masked (model)¶
{
surfaceparm nonsolid
radialNormals
{
map $texturename
rgbGen lightingDiffuse
alphaFunc LT128
depthWrite
}
}
Metal masked (world)¶
{
surfaceparm metal
surfaceparm trans
surfaceparm alphashadow
surfaceparm nomarks
surfaceparm nonsolid
surfaceparm playerclip
surfaceparm monsterclip
nopicmip
{
map $texturename
rgbGen exactVertex
alphaFunc GE128
depthWrite
nextbundle
map $lightmap
}
}
Metal masked solid (world)¶
{
surfaceparm metal
surfaceparm trans
surfaceparm alphashadow
surfaceparm nomarks
surfaceparm nonsolid
surfaceparm playerclip
surfaceparm monsterclip
nopicmip
{
map $texturename
rgbGen exactVertex
alphaFunc GE128
depthWrite
nextbundle
map $lightmap
}
}
Wood masked (model)¶
{
surfaceparm wood
{
map $texturename
rgbGen lightingDiffuse
}
}
Cloth masked (model)¶
{
surfaceparm cloth
{
map $texturename
rgbGen lightingDiffuse
}
}
Flesh masked (model)¶
{
surfaceparm flesh
{
map $texturename
rgbGen lightingDiffuse
}
}
Pickup masked (model - glowing items)¶
{
surfaceparm wood
{
map $texturename
rgbGen lightingDiffuse
}
}
Environment Mapped Materials¶
Metal with environment map (model)¶
{
surfaceparm metal
nomipmaps
{
map textures/sfx/environmap_1day.jpg
tcgen environment
rgbgen lightingdiffuse
}
{
map $texturename
blendFunc GL_ONE_MINUS_SRC_ALPHA GL_SRC_ALPHA
rgbgen lightingdiffuse
}
}
Wood with wet environment map (model)¶
{
surfaceparm wood_env
nomipmaps
nopicmip
{
map textures/sfx/environmap_wet.tga
tcgen environment
rgbgen lightingdiffuse
}
{
map $texturename
blendFunc GL_ONE_MINUS_SRC_ALPHA GL_SRC_ALPHA
rgbgen lightingdiffuse
}
}
Blended Materials¶
Cloth blend (model)¶
{
surfaceparm cloth
{
map $texturename
rgbGen lightingDiffuse
blendFunc blend
}
}
Foliage blend (model)¶
{
surfaceparm nonsolid
radialNormals
{
map $texturename
rgbGen lightingDiffuse
blendFunc blend
}
}
Foliage blend (world)¶
{
surfaceparm foliage
surfaceparm nomarks
{
map $texturename
rgbGen exactVertex
blendFunc blend
}
}
Cloth blend out (model)¶
{
surfaceparm cloth
{
map $texturename
rgbGen lightingDiffuse
blendFunc blend
}
}
Cloth blend in (model)¶
{
surfaceparm cloth
{
map $texturename
rgbGen lightingDiffuse
blendFunc blend
}
}
Special Purpose Shadertypes¶
Decal (model)¶
{
surfaceparm nonsolid
polygonOffset
{
map $texturename
rgbGen lightingDiffuse
blendFunc blend
}
}
Decal (world)¶
{
surfaceparm nonsolid
surfaceparm trans
surfaceparm noncolliding
polygonOffset
{
map $texturename
rgbGen exactVertex
blendFunc blend
nextbundle
map $lightmap
}
}
Decal with depth write (world)¶
{
surfaceparm nonsolid
surfaceparm trans
surfaceparm noncolliding
polygonOffset
{
map $texturename
rgbGen exactVertex
blendFunc blend
depthwrite
nextbundle
map $lightmap
}
}
Alpha shadow (world)¶
{
surfaceparm castshadow
surfaceparm nomarks
surfaceparm nolightmap
surfaceparm alphashadow
surfaceparm nonsolid
{
map $texturename
rgbGen exactVertex
alphaFunc GE128
depthWrite
nextbundle
map $lightmap
}
}
Viewmodel (first-person weapon)¶
{
surfaceparm metal
nomipmaps
{
map $texturename
rgbGen lightingDiffuse
}
}
Viewhands (first-person hands)¶
{
surfaceparm flesh
nomipmaps
{
map noopt $texturename
rgbGen lightingDiffuse
}
}
Metal fence (world)¶
{
surfaceparm metal
surfaceparm trans
surfaceparm alphashadow
surfaceparm nomarks
surfaceparm nonsolid
surfaceparm playerclip
surfaceparm monsterclip
nomipmaps
nopicmip
{
map $texturename
rgbGen exactVertex
alphaFunc GE128
depthWrite
nextbundle
map $lightmap
}
}
Animated/Glowing Materials¶
Objective (model - glowing objective marker)¶
{
{
map $texturename
rgbGen lightingDiffuse
}
{
map $whiteimage
rgbgen constLighting ( 0.20 0.158 0.062 )
blendFunc add
}
{
map $whiteimage
rgbgen constLighting ( 0.8 0.632 0.252 )
alphaGen wave sin -0.1 1.1 0 .5
blendFunc GL_SRC_ALPHA GL_ONE
}
}
Objective incomplete (model)¶
{
{
map $textureName
rgbgen constLighting ( 0.40 0.316 0.124 )
blendFunc add
}
{
map $whiteImage
rgbgen constLighting ( 0.8 0.632 0.252 )
alphaGen wave sin -0.1 1.1 0 .5
blendFunc GL_SRC_ALPHA GL_ONE
}
}
Pickup (model - collectible items with glow)¶
{
{
map $texturename
rgbGen lightingDiffuse
}
{
map $texturename
blendFunc add
rgbGen wave sin 0.11 0.31 0 0.8
}
}
Pickup masked (model)¶
{
surfaceparm wood
{
map $texturename
rgbGen lightingDiffuse
}
}
Objective masked (model)¶
{
surfaceparm wood
{
map $texturename
rgbGen lightingDiffuse
}
}
Objective incomplete masked (model)¶
{
surfaceparm wood
{
map $texturename
rgbGen lightingDiffuse
}
}
Terrain Materials¶
Dirt (world)¶
{
surfaceparm dirt
{
map $texturename
rgbGen exactVertex
}
}
Rock (world)¶
{
surfaceparm rock
{
map $texturename
rgbGen exactVertex
}
}
Brick (world)¶
{
surfaceparm brick
{
map $texturename
rgbGen exactVertex
}
}
Mud (world)¶
{
surfaceparm mud
{
map $texturename
rgbGen exactVertex
}
}
Sand (world)¶
{
surfaceparm sand
{
map $texturename
rgbGen exactVertex
}
}
Plaster (world)¶
{
surfaceparm plaster
{
map $texturename
rgbGen exactVertex
}
}
Bark (world)¶
{
surfaceparm bark
{
map $texturename
rgbGen exactVertex
}
}
Ice (world)¶
{
surfaceparm snow
{
map $texturename
rgbGen exactVertex
}
}
Clamped Texture Shadertypes¶
For textures that need clamping to avoid seam issues:
Foliage clamp X (world)¶
{
surfaceparm foliage
surfaceparm nomarks
{
map $texturename
rgbGen exactVertex
alphaFunc GE128
depthWrite
nextbundle
map $lightmap
}
}
Grass clamp Y (world)¶
{
surfaceparm grass
{
map $texturename
rgbGen exactVertex
}
{
map $lightmap
blendFunc filter
}
}
Rock clamp Y (world)¶
{
surfaceparm rock
{
map $texturename
rgbGen exactVertex
}
}
Dirt clamp Y (world)¶
{
surfaceparm dirt
{
map $texturename
rgbGen exactVertex
}
}
Autosprite¶
Autosprite masked (world - for billboarded objects)¶
{
surfaceparm nonsolid
surfaceparm nomarks
polygonOffset
{
map $texturename
rgbGen exactVertex
blendFunc blend
}
}
Snow clamp X/Y (world)¶
{
surfaceparm snow
{
map $texturename
rgbGen exactVertex
}
}
Decal Clamp Variants¶
Decal clamp (world)¶
{
surfaceparm nonsolid
surfaceparm trans
surfaceparm noncolliding
polygonOffset
{
map $texturename
rgbGen exactVertex
blendFunc blend
nextbundle
map $lightmap
}
}
Decal clamp X (world)¶
{
surfaceparm nonsolid
surfaceparm trans
surfaceparm noncolliding
polygonOffset
{
map $texturename
rgbGen exactVertex
blendFunc blend
nextbundle
map $lightmap
}
}
Decal clamp Y (world)¶
{
surfaceparm nonsolid
surfaceparm trans
surfaceparm noncolliding
polygonOffset
{
map $texturename
rgbGen exactVertex
blendFunc blend
nextbundle
map $lightmap
}
}
Decal metal no mask (world)¶
{
surfaceparm nonsolid
surfaceparm trans
surfaceparm noncolliding
polygonOffset
{
map $texturename
rgbGen exactVertex
blendFunc blend
nextbundle
map $lightmap
}
}
Decal solid clamp Y (world)¶
{
surfaceparm nonsolid
surfaceparm trans
surfaceparm noncolliding
polygonOffset
{
map $texturename
rgbGen exactVertex
blendFunc blend
nextbundle
map $lightmap
}
}
Wheel Materials¶
Wheel metal (model)¶
{
surfaceparm metal
{
map $texturename
rgbGen lightingDiffuse
}
}
Wheel metal masked (model)¶
{
surfaceparm metal
{
map $texturename
rgbGen lightingDiffuse
}
}
Tread metal (model)¶
{
surfaceparm metal
{
map $texturename
rgbGen lightingDiffuse
}
}
Tread metal masked (model)¶
{
surfaceparm metal
{
map $texturename
rgbGen lightingDiffuse
}
}
No-Fog Materials¶
No-fog metal (model)¶
{
surfaceparm metal
{
map $texturename
rgbGen lightingDiffuse
}
}
No-fog glass blend out (model)¶
{
surfaceparm glass
sort outerBlend
nofog
nomipmaps
nopicmip
{
map $texturename
rgbGen lightingDiffuse
blendFunc blend
}
}
Glass variants¶
Broken glass blend in (model)¶
{
surfaceparm nonsolid
sort innerBlend
nomipmaps
nopicmip
{
map $texturename
rgbGen lightingDiffuse
blendFunc blend
}
}
Broken glass blend out (model)¶
{
surfaceparm glass
surfaceparm nonsolid
sort innerBlend
nomipmaps
nopicmip
{
map $texturename
rgbGen lightingDiffuse
blendFunc blend
}
}
Glass blend out (world)¶
{
surfaceparm glass
surfaceparm trans
sort outerBlend
{
map $texturename
rgbGen exactVertex
blendFunc blend
nextbundle
map $lightmap
}
}
Glass blend in (world)¶
{
surfaceparm glass
surfaceparm trans
sort innerBlend
{
map $texturename
rgbGen exactVertex
blendfunc blend
nextbundle
map $lightmap
}
}
Glass masked (world)¶
{
surfaceparm glass
surfaceparm trans
surfaceparm nomarks
{
map $texturename
rgbGen exactVertex
}
}
Glass light (model)¶
{
surfaceparm glass
surfaceparm noshadow
{
map $texturename
rgbGen identityLighting
}
}
Fancy Animated Weapon Skin¶
// Made by Kazam
{
surfaceparm metal
nomipmaps
{
map textures/kazam_skins/purple_overlay1.dds
tcMod scroll 0.0125 0.0125
tcGen environment
}
{
map textures/kazam_skins/starrysky_overlay2.dds
blendFunc blend
alphaGen wave sin -0.1 1.1 0 .125
tcMod scroll 0.125 0.125
tcMod rotate 5
}
{
map textures/kazam_skins/starrysky_overlay2.dds
blendFunc blend
alphaGen wave sin -0.1 1.1 0 .25
tcMod scroll -0.125 -0.125
tcMod rotate -5
}
}