UnlitGeneric: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
Line 6: Line 6:


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


=== Transparency ===
=== Transparency ===
{{MatParam|[[$alpha]]|float|Scales the opacity of an entire material.}}
{{MatParam|[[$alpha]]|normal|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|[[$nocull]]|bool|Disables backface culling, resulting in triangles showing from both sides.}}
{{MatParam|[[$nocull]]|bool|Disables backface culling, resulting in triangles showing from both sides.}}
Line 20: Line 20:


=== Texture Organization ===
=== Texture Organization ===
{{MatParam|[[%keywords]]|bool|Sets a keyword filter that can be filtered in hammer for easier texture finding.}}
{{MatParam|[[%keywords]]|string|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]].}}

Revision as of 10:20, 4 June 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|$surfaceprop]] [[$model|$model]]

Adjustment

[[$color|$color]]

Transparency

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

Texture Organization

[[%keywords|%keywords]] [[%notooltexture|%notooltexture]] [[%tooltexture|%tooltexture]]

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.