UnlitGeneric: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
m (Uses MatParam template for material parameters)
Line 6: Line 6:


=== Basics ===
=== Basics ===
;{{ent|$basetexture}}
{{MatParam|[[$basetexture]]|texture|Defines an albedo texture}}
: Defines an albedo texture
{{MatParam|$surfaceprop|string|Links the [[$surfaceprop|surface]] to a set of physical properties.}}
;{{ent|$surfaceprop}}
{{MatParam|[[%tooltexture]]|texture|Used to blend texture previews in [[Hammer]].}}
: Links the surface to a set of physical properties.
{{MatParam|[[$model_(VMT)|$model]]|bool|Tells this material is used for [[$model_(QC)|models]] and not [[Brush|brushes]].}}
;{{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.


=== 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|[[$translucent]]|bool|Specifies that the material should be partially see-through.}}
: Specifies a mask to use to determine binary opacity.
;{{ent|$translucent}}
: Specifies that the material should be partially see-through.


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


== Additional Parameters ==
== Additional Parameters ==


{{MatParam|[[$receiveflashlight]]|bool|Allow the player's flashlight to illuminate the material.}}
{{MatParam|[[$receiveflashlight]]|bool|Allow the player's flashlight to illuminate the material.}}
{{MatParam|[[$singlepassflashlight]]|bool|Possibly used to allow shadows to form from this decal. For example, found in L4D2 decals/detail/ruraldetailsprites.vmt {{todo|confirm.}}}}
{{MatParam|[[$singlepassflashlight]]|bool|Possibly used to allow shadows to form from this decal.<br/>For example, found in L4D2 ''decals/detail/ruraldetailsprites.vmt''<br/>{{todo|confirm.}}}}


== Caveats ==
== Caveats ==
Line 44: Line 37:


=== Models ===
=== Models ===
If this shader is being used on a [[model]], you must specify <code>[[$model|$model 1]]</code> to prevent errors.
If this shader is being used on a [[model]], you must specify <code>[[$model_(VMT)|$model 1]]</code> to prevent errors.


=== Mapbase ===
=== Mapbase ===

Revision as of 00:57, 21 March 2023

English (en)Français (fr)中文 (zh)Translate (Translate)

UnlitGeneric draws an albedo without standard lighting passes. It is used for things like UI images, pure white, and pitch blackness, but also in situations when software lighting is used (like on detail props).

Supported Parameters

Basics

[[$basetexture|$basetexture]] $surfaceprop [[%tooltexture|%tooltexture]] [[$model|$model]]

Adjustment

[[$color|$color]]

Transparency

[[$alpha|$alpha]] [[$alphatest|$alphatest]] [[$translucent|$translucent]]

Effect

[[$nofog|$nofog]]

Additional Parameters

[[$receiveflashlight|$receiveflashlight]] [[$singlepassflashlight|$singlepassflashlight]]

Caveats

Projected Texture Bugs

If a Skybox has an UnlitGeneric shader applied to it, some visual bugs can occur. Notably, if a projected texture is shone near a Skybox using an UnlitGeneric shader, the Skybox will appear to ignore surrounding geometry and phase through walls for as long as the projected texture is active.

To fix this, ensure that a sky_camera exists in the world, typically in its own box which exists outside of the rest of the map.

Preferably, use the purpose-built Sky shader instead.

Models

If this shader is being used on a model, you must specify $model 1 to prevent errors.

Mapbase

Unlit materials in Mapbase should have the shader SDK_UnlitGeneric.