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 Jump to search
English (en)Français (fr)Русский (ru)Translate (Translate)

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.
$blendmodulatetexture <texture> (in all games since Source 2006)
Control sharpness and bias of blend. See Blendmodulate
$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 ModMapbase)
Diffuse reflections.
Note.pngNote:Phong is reflected only from env_cascade_light.
Todo: Are there reflections from any other light sources?.
Warning.pngWarning:Standard phong color is always white and doesn'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.  [todo tested in?]
$phong_exp <float> (only in Lambda Wars)
Confirm:Is this for LW's Blinn–Phong reflections?
$phong_exp2 <float> (only in Lambda Wars)
Confirm:Is this for LW's Blinn–Phong reflections?

Portal 2Paint

The paint splat normal map to use when paint is applied to the material. Defaults to paint/splatnormal_default if not specified.
The layout texture which defines the distribution of bubbles in the paint. Defaults to paint/bubblelayout if not specified.
The normal mapped texture of a single bubble. Defaults to paint/bubble if not specified.
The environment map reflected in the paint. Defaults to paint/paint_envmap_hdr if not specified.


Texture Organization

Sets keywords (comma separated) filter that can be filtered in hammer for easier texture finding.
PlacementTip.pngExample:%keywords "wasteland,c17" place the material under the "wasteland" and "c17" filters.
Hides the material from Hammer's texture browser.
Warning.pngWarning:Non-functional in Hammer++ Hammer++.
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