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 (Fix some formatting)
Line 16: Line 16:
{{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|$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|$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|$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|$detailscale|float|Fits the detail texture onto the material the given number of times (default {{=}} 4). Generally used instead of {{mono|$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: {{mono|$detailscale "[ 4 8 ]"}}}}
{{MatParam|$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|$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|$detailblendmode|int|How to combine the detail material with the albedo.}}
{{MatParam|$detailblendmode|int|How to combine the detail material with the albedo.}}
{{MatParam|$modelmaterial|material|A separate [[VertexLitGeneric]] material to that will replace this one if the decal hits a [[Model|model]]. }}
{{MatParam|$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|bool|only={{csgo}}|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.}}
Line 32: Line 32:
=== 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 56: Line 56:


=== Mapbase ===
=== Mapbase ===
LightmappedGeneric materials in [[Mapbase]] should have the shader '''<code>SDK_LightmappedGeneric</code>'''.
LightmappedGeneric materials in [[Mapbase]] should have the shader '''{{mono|SDK_LightmappedGeneric}}'''.




== See also ==
== See also ==
*<code>[[WorldVertexTransition]]</code>, a shader used on displacements to blend two materials together.
*{{mono|[[WorldVertexTransition]]}}, a shader used on displacements to blend two materials together.
*<code>[[LightmappedTwoTexture]]</code>, a brush shader that multiplies a texture on top of another one.
*{{mono|[[LightmappedTwoTexture]]}}, a brush shader that multiplies a texture on top of another one.
*<code>[[Lightmapped_4WayBlend]]</code>, a shader used on displacements to blend up to four materials together.
*{{mono|[[Lightmapped_4WayBlend]]}}, a shader used on displacements to blend up to four materials together.

Revision as of 19:53, 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 using this shader on models.

Todo: Which other games support it?

Supported Parameters

Basics

$basetexture $decal $detail $surfaceprop

Adjustment

$basetexturetransform $color $decalscale $detailscale $detailblendfactor $detailblendmode $modelmaterial $pointsamplemagfilter $seamless_scale

Transparency

$alpha $alphatest $distancealpha $nocull $translucent

Lighting

$bumpmap $lightwarptexture $selfillum $ssbump

Reflection

$envmap $phong

Texture Organization

%keywords %notooltexture %tooltexture

Effect

$nofog

Caveats

Mapbase

LightmappedGeneric materials in Mapbase should have the shader SDK_LightmappedGeneric.


See also