UnlitGeneric

From Valve Developer Community
< Zh
Revision as of 03:17, 24 April 2025 by MoRanYue (talk | contribs)
Jump to navigation Jump to search
Under construction.png
This page is actively undergoing a major edit.
As a courtesy, please do not edit this while this message is displayed.
If this page has not been edited for at least several hours to a few days, please remove this template. This message is intended to help reduce edit conflicts; please remove it between editing sessions to allow others to edit the page.

The person who added this notice will be listed in its edit history should you wish to contact them.

Info content.png
This page is being translated.
You can help by finishing the translation.
If this page cannot be translated for some reason, or is left untranslated for an extended period of time after this notice is posted, the page should be requested to be deleted.
Also, please make sure the article complies with the alternate languages guide.(en)
English (en)Français (fr)中文 (zh)Translate (Translate)

UnlitGeneric draws a diffuse(en) 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 prop(en)s).

Supported Parameters

Basics

$basetexture $surfaceprop $model

Adjustment

$detail $color

Transparency

$alpha $alphatest $nocull $translucent $vertexalpha

Texture Organization

%keywords %notooltexture %tooltexture

Effect

$nofog

Additional Parameters

$receiveflashlight $singlepassflashlight $deferred

Caveats

Projected Texture Bugs

If a Skybox(en) 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 may 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(en) exists in the world, typically in its own box which exists outside of the rest of the map.

Preferably, use the purpose-built Sky(en) shader instead.

Models

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

Mapbase

Unlit materials in Mapbase(en) should have the shader SDK_UnlitGeneric.