This article's documentation is for anything that uses the Source engine. Click here for more information.

LightmappedGeneric

From Valve Developer Community
Jump to: navigation, search

English (en)français (fr)русский (ru)
... Icon-Important.png

LightmappedGeneric is a pixel shader available in all Source Source games. It is the shader most commonly used to render lightmapped brushes and displacements.

Models cannot use this shader; lightmapped models use the VertexLitGeneric shader.

Supported Parameters

Basics

Defines an diffuse texture.
Use this material as a decal.
Detail texturing.
Links the surface to a set of physical properties.

Adjustment

Transforms the texture before use in the material. This does not affect lightmaps on the surface.
Independently scales the red, green and blue channels of an albedo.
Same as a brush face's texture scale value: the number of units that each texel covers. Normally 0.25 or lower.
Fits the detail texture onto the material the given number of times (default = 4). Generally used instead of $detailtexturetransform with a value of around 7 or 8 for a 128px detail texture. To independently scale the X and Y coordinates, place your values in brackets: $detailscale "[ 4 8 ]"
Controls the amount that the detail texture affects the base texture. The precise use of this depends on the blend factor; in most cases it acts similarly to $alpha. A value of 0 usually makes the detail texture have no effect, whilst a value of 1 applies the full effect.
How to combine the detail material with the albedo.
A separate VertexLitGeneric material to that will replace this one if the decal hits a model.
Disables texture filtering.
$seamless_scale <float> (in all games since Source 2007)
Mitigation for displacement texture stretching.

Transparency

Scales the opacity of an entire material.
Icon-Important.pngImportant:Can result in alpha sorting issues if brush is flagged as detail or tied to an entity!
Specifies a mask to use to determine binary opacity.
$distancealpha <boolean> (in all games since Source 2007)
Vector-like edge filtering.
Disables backface culling.
Specifies that the material should be partially see-through.
Icon-Important.pngImportant:Can result in alpha sorting issues if brush is flagged as detail or tied to an entity!

Lighting

Specifies a texture that will provide three-dimensional lighting information for a material.
$lightwarptexture <texture> (in all games since Source 2006)
Per-texel color modification via a warp texture.
Note.pngNote:Does not appear to be featured on LightmappedGeneric in CS:GO engine branch CS:GO engine branch.
Determines whether the surface is self-illuminated independent of environment lighting.
$ssbump <boolean> (in all games since Source 2007)
Flags the $bumpmap as being a self-shadowing bumpmap.

Reflection

Specular reflections.
$phong <boolean> (in all games since Counter-Strike: Global Offensive) (also in Garry's Mod)
Diffuse reflections.
Note.pngNote:Phong is reflected only from env_cascade_light.
Blank image.pngTodo: Are there reflections from any other light sources?.
Warning.pngWarning:Standard phong color is always white and don't depend on the color of light_environment or env_cascade_light.
Icon-Bug.pngBug:Normal map does not affect phong reflections if there is empty $envmap on the material, or if you haven't assigned any brush face on env_cubemap entity.

Texture Organization

Sets a keyword filter that can be filtered in hammer for easier texture finding.
Hides the material from Hammer's texture browser.
Used to blend texture previews in Hammer.

Effect

Prevents fog from overdrawing a material.

Caveats

Mapbase

LightmappedGeneric materials in Mapbase should have the shader SDK_LightmappedGeneric.


See also