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

LightmappedGeneric: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Mat Parmesan template links to pages automatically now)
Line 7: Line 7:


=== Basics ===
=== Basics ===
{{MatParam|[[$basetexture]]|texture|Defines an albedo texture.}}
{{MatParam|$basetexture|texture|Defines an albedo texture.}}
{{MatParam|[[$decal]]|bool|Use this material as a decal.}}
{{MatParam|$decal|bool|Use this material as a decal.}}
{{MatParam|[[$detail]]|texture|Detail texturing.}}
{{MatParam|$detail|texture|Detail texturing.}}
{{MatParam|[[$surfaceprop]]|string|Links the surface to a set of physical properties.}}
{{MatParam|$surfaceprop|string|Links the surface to a set of physical properties.}}


=== Adjustment ===
=== Adjustment ===
{{MatParam|[[$basetexture|$basetexturetransform]]|matrix| Transforms the texture before use in the material. This does not affect [[lightmap]]s on the surface. }}
{{MatParam|$basetexture|$basetexturetransform|matrix| Transforms the texture before use in the material. This does not affect [[lightmap]]s on the surface. }}
{{MatParam|[[$color]]|RGB matrix|Independently scales the red, green and blue channels of an albedo.}}
{{MatParam|$color|RGB matrix|Independently scales the red, green and blue channels of an albedo.}}
{{MatParam|[[Decal|$decalscale]]|float|Same as a brush face's texture scale value: the number of [[unit|units]] that each [[texel]] covers. Normally 0.25 or lower. }}
{{MatParam|Decal|$decalscale|float|Same as a brush face's texture scale value: the number of [[unit|units]] that each [[texel]] covers. Normally 0.25 or lower. }}
{{MatParam|[[$detail|$detailscale]]|float|Fits the detail texture onto the material the given number of times (default {{=}} 4). Generally used instead of <code>$detailtexturetransform</code> 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: <code>$detailscale "[ 4 8 ]"</code>}}
{{MatParam|$detail|$detailscale|float|Fits the detail texture onto the material the given number of times (default {{=}} 4). Generally used instead of <code>$detailtexturetransform</code> 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: <code>$detailscale "[ 4 8 ]"</code>}}
{{MatParam|[[$detail|$detailblendfactor]]|normal|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.}}
{{MatParam|$detail|$detailblendfactor|normal|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.}}
{{MatParam|[[$detail|$detailblendmode]]|int|How to combine the detail material with the albedo.}}
{{MatParam|$detail|$detailblendmode|int|How to combine the detail material with the albedo.}}
{{MatParam|[[Decal|$modelmaterial]]|material|A separate [[VertexLitGeneric]] material to that will replace this one if the decal hits a [[Model|model]]. }}
{{MatParam|Decal|$modelmaterial|material|A separate [[VertexLitGeneric]] material to that will replace this one if the decal hits a [[Model|model]]. }}
{{MatParam|[[$pointsamplemagfilter]] {{only|{{csgo}}}}|bool|Disables texture filtering.}}
{{MatParam|$pointsamplemagfilter]] {{only|{{csgo}}}}|bool|Disables texture filtering.}}
{{MatParam|[[$seamless_scale]] {{since|{{src07}}}}]]|float|Mitigation for displacement texture stretching.}}
{{MatParam|$seamless_scale]] {{since|{{src07}}}}|float|Mitigation for displacement texture stretching.}}


=== Transparency ===
=== Transparency ===
{{MatParam|[[$alpha]]|float|Scales the opacity of an entire material.}}
{{MatParam|$alpha|float|Scales the opacity of an entire material.}}
{{MatParam|[[$alphatest]]|bool|Specifies a mask to use to determine binary opacity.}}
{{MatParam|$alphatest|bool|Specifies a mask to use to determine binary opacity.}}
{{MatParam|[[$distancealpha]] {{since|{{src07}}}}|bool|Vector-like edge filtering.}}
{{MatParam|$distancealpha]] {{since|{{src07}}}}|bool|Vector-like edge filtering.}}
{{MatParam|[[$nocull]]|bool|Disables backface culling.}}
{{MatParam|$nocull|bool|Disables backface culling.}}
{{MatParam|[[$translucent]]|bool|Specifies that the material should be partially see-through.}}
{{MatParam|$translucent|bool|Specifies that the material should be partially see-through.}}


=== Lighting ===
=== Lighting ===
{{MatParam|[[$bumpmap]]|texture|Specifies a texture that will provide three-dimensional lighting information for a material.}}
{{MatParam|$bumpmap|texture|Specifies a texture that will provide three-dimensional lighting information for a material.}}
{{MatParam|[[$lightwarptexture]] {{since|{{src06}}}}|texture|Per-texel color modification via a warp texture.  
{{MatParam|$lightwarptexture]] {{since|{{src06}}}}|texture|Per-texel color modification via a warp texture.  
{{Note|Does not appear to be featured on {{ent|LightmappedGeneric}} in {{csgobranch|4}}.}}}}
{{Note|Does not appear to be featured on {{ent|LightmappedGeneric}} in {{csgobranch|4}}.}}}}
{{MatParam|[[$selfillum]]|bool|Determines whether the surface is self-illuminated independent of environment lighting.}}
{{MatParam|$selfillum|bool|Determines whether the surface is self-illuminated independent of environment lighting.}}
{{MatParam|[[$ssbump]] {{since|{{src07}}}}|bool|Flags the {{ent|$bumpmap}} as being a self-shadowing bumpmap.}}
{{MatParam|$ssbump]] {{since|{{src07}}}}|bool|Flags the {{ent|$bumpmap}} as being a self-shadowing bumpmap.}}


=== Reflection ===
=== Reflection ===
{{MatParam|[[$envmap]]|cubemap|Specular reflections.}}
{{MatParam|$envmap|cubemap|Specular reflections.}}
{{MatParam|[[$phong]] {{only|{{csgo}}}}|bool|Diffuse reflections.
{{MatParam|$phong]] {{only|{{csgo}}}}|bool|Diffuse reflections.
{{note|Phong is reflected only from [[env_cascade_light]].}}
{{note|Phong is reflected only from [[env_cascade_light]].}}
:{{todo|Are there reflections from any other light sources?.}}  
:{{todo|Are there reflections from any other light sources?.}}  
Line 46: Line 46:


=== Texture Organization ===
=== Texture Organization ===
{{MatParam|[[%keywords]]|bool|Sets a keyword filter that can be filtered in hammer for easier texture finding.}}
{{MatParam|%keywords|bool|Sets a keyword filter that can be filtered in hammer for easier texture finding.}}
{{MatParam|[[%notooltexture]]|bool|Hides the material from Hammer's texture browser.}}
{{MatParam|%notooltexture|bool|Hides the material from Hammer's texture browser.}}
{{MatParam|[[%tooltexture]]|texture|Used to blend texture previews in [[Hammer]].}}
{{MatParam|%tooltexture|texture|Used to blend texture previews in [[Hammer]].}}


=== Effect ===
=== Effect ===
{{MatParam|[[$nofog]]|bool|Prevents fog from overdrawing a material.}}
{{MatParam|$nofog|bool|Prevents fog from overdrawing a material.}}


== Caveats ==
== Caveats ==

Revision as of 19:44, 25 June 2023

English (en)Français (fr)Русский (ru)Translate (Translate)

Shader-ball.png LightmappedGeneric It is the shader most commonly used to render brushes, displacements and lightmapped surfaces.

Only some games like Team Fortress 2 support this shader to be used on models.

Todo: Which other games support it?

Supported Parameters

Basics

$basetexture $decal $detail $surfaceprop

Adjustment

$basetexture $color Decal $detail $detail $detail Decal $pointsamplemagfilter (only in counter-strike: global offensive)|$pointsamplemagfilter]] (only in Counter-Strike: Global Offensive)]] $seamless_scale (in all games since source 2007)|$seamless_scale]] (in all games since Source 2007)]]

Transparency

$alpha $alphatest $distancealpha (in all games since source 2007)|$distancealpha]] (in all games since Source 2007)]] $nocull $translucent

Lighting

$bumpmap $lightwarptexture (in all games since source 2006)|$lightwarptexture]] (in all games since Source 2006)]] $selfillum $ssbump (in all games since source 2007)|$ssbump]] (in all games since Source 2007)]]

Reflection

$envmap $phong (only in counter-strike: global offensive)|$phong]] (only in Counter-Strike: Global Offensive)]]

Texture Organization

%keywords %notooltexture %tooltexture

Effect

$nofog

Caveats

Mapbase

LightmappedGeneric materials in Mapbase should have the shader SDK_LightmappedGeneric.


See also