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 (→‎Lighting: CS:GO Caveat for $LightwarpTexture / consistency)
(Uses MatParam template for material parameters)
Line 7: Line 7:


=== Basics ===
=== Basics ===
;{{ent|$basetexture}}
{{MatParam|[[$basetexture]]|texture|Defines an albedo texture.}}
: Defines an albedo texture.
{{MatParam|[[$decal]]|bool|Use this material as a decal.}}
;{{ent|$decal}}
{{MatParam|[[$detail]]|texture|Detail texturing.}}
: Use this material as a decal.
{{MatParam|[[$surfaceprop]]|string|Links the surface to a set of physical properties.}}
;{{ent|$detail}}
{{MatParam|[[%tooltexture]]|material|Used to blend texture previews in Hammer.}}
: Detail texturing.
;{{ent|$surfaceprop}}
: Links the surface to a set of physical properties.
;{{ent|%tooltexture}}
: Used to blend texture previews in Hammer.


=== Adjustment ===
=== Adjustment ===
;{{ent|$color}}
{{MatParam|[[$color]]|RGB matrix|Independently scales the red, green and blue channels of an albedo.}}
: Independently scales the red, green and blue channels of an albedo.
{{MatParam|[[$pointsamplemagfilter]] {{only|{{csgo}}}}|bool|Disables texture filtering.}}
;{{ent|$pointsamplemagfilter}} {{only|{{csgo}}}}
{{MatParam|[[$seamless_scale]] {{since|{{src07}}}}]]|float|Mitigation for displacement texture stretching.}}
: Disables texture filtering.
;{{ent|$seamless_scale}} {{since|{{src07}}}}
: Mitigation for displacement texture stretching.


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


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


=== Reflection ===
=== Reflection ===
;{{ent|$envmap}}
{{MatParam|[[$envmap]]|cubemap|Specular reflections.}}
: Specular reflections.
{{MatParam|[[$phong]] {{only|{{csgo}}}}|bool|Diffuse reflections.
;{{ent|$phong}} {{only|{{csgo}}}}
{{note|Phong is reflected only from [[env_cascade_light]].}}
: Diffuse reflections.
:{{todo|Are there reflections from any other light sources?.}}  
:{{note|Phong is reflected only from [[env_cascade_light]].}} {{todo|Are there reflections from any other light sources?.}}  
{{warning|Standard phong color is always white and don't depend on the color of [[light_environment]] or [[env_cascade_light]].}}
:{{warning|Standard phong color is always white and don't depend on the color of [[light_environment]] or [[env_cascade_light]].}}
{{bug|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.}}}}
:{{bug|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.}}


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


== Caveats ==
== Caveats ==

Revision as of 11:34, 3 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|$basetexture]] [[$decal|$decal]] [[$detail|$detail]] [[$surfaceprop|$surfaceprop]] [[%tooltexture|%tooltexture]]

Adjustment

[[$color|$color]] [[$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|$alpha]] [[$alphatest|$alphatest]] [[$distancealpha (in all games since source 2007)|$distancealpha (in all games since Source 2007)]] [[$nocull|$nocull]] [[$translucent|$translucent]]

Lighting

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

Reflection

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

Effect

[[$nofog|$nofog]]

Caveats

Mapbase

LightmappedGeneric materials in Mapbase should have the shader SDK_LightmappedGeneric.


See also