Difference between revisions of "UnlitGeneric"

From Valve Developer Community
Jump to: navigation, search
m
 
(15 intermediate revisions by 2 users not shown)
Line 1: Line 1:
'''<code>UnlitGeneric</code>''' 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 prop]]s). It accepts only the most rudimentary of VMT commands.
+
{{lang | UnlitGeneric}}
  
{{warning|If this shader is being used on a [[model]], you must specify <code>[[$model|$model 1]]</code> to prevent errors.}}
+
'''<code>UnlitGeneric</code>''' 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 prop]]s).
  
== Projected Texture Bugs ==
+
== Supported Parameters ==
If a [[Skybox]] has an '''<code>UnlitGeneric</code>''' shader applied to it, some visual bugs can occur. Notably, if a projected texture is shone near a Skybox using an '''<code>UnlitGeneric</code>''' shader, the Skybox will appear to ignore surrounding geometry and phase through walls for as long as the projected texture is active.
+
 
 +
=== Basics ===
 +
;{{ent|$basetexture}}
 +
: Defines an albedo texture
 +
;{{ent|$surfaceprop}}
 +
: Links the surface to a set of physical properties.
 +
;{{ent|%tooltexture}}
 +
: Used to blend texture previews in Hammer.
 +
 
 +
=== Adjustment ===
 +
;{{ent|$color}}
 +
: Independently scales the red, green and blue channels of an albedo.
 +
 
 +
=== Transparency ===
 +
;{{ent|$alpha}}
 +
: Scales the opacity of an entire material.
 +
;{{ent|$alphatest}}
 +
: Specifies a mask to use to determine binary opacity.
 +
;{{ent|$translucent}}
 +
: Specifies that the material should be partially see-through.
 +
 
 +
=== Effect ===
 +
;{{ent|$nofog}}
 +
: Prevents fog from overdrawing a material.
 +
 
 +
== Additional Parameters ==
 +
 
 +
{{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.}}}}
  
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.
+
== Caveats ==
  
Preferably, use the purpose-built [[Sky_(shader)|sky shader]] instead.
+
=== Projected Texture Bugs ===
 +
If a [[Skybox]] has an '''<code>UnlitGeneric</code>''' shader applied to it, some visual bugs can occur. Notably, if a projected texture is shone near a Skybox using an '''<code>UnlitGeneric</code>''' shader, the Skybox will appear to ignore surrounding geometry and phase through walls for as long as the projected texture is active.
  
== Parameters ==
+
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.
  
; <code>$receiveflashlight 1</code>
+
Preferably, use the purpose-built '''<code>[[Sky_(shader)|Sky]]</code>''' shader instead.
: Allow the player's flashlight to illuminate the material.
 
; <code>$singlepassflashlight 1</code>
 
: Possibly used to allow shadows to form from this decal. For example, found in L4D2 decals/detail/ruraldetailsprites.vmt {{todo|confirm.}}
 
  
== Supported effects ==
+
=== Models ===
 +
If this shader is being used on a [[model]], you must specify <code>[[$model|$model 1]]</code> to prevent errors.
  
*<code>[[$translucent]]</code> and <code>[[$alpha]]</code>
+
=== Mapbase ===
*<code>[[$detail]]</code>
+
Unlit materials in [[Mapbase]] should have the shader '''<code>SDK_UnlitGeneric</code>'''.
*<code>[[$outline]]</code>
 
  
 
[[Category:Shaders]]
 
[[Category:Shaders]]
 
[[Category:Stubs]]
 
[[Category:Stubs]]

Latest revision as of 07:31, 16 October 2021

English Français

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
Defines an albedo texture
$surfaceprop
Links the surface to a set of physical properties.
%tooltexture
Used to blend texture previews in Hammer.

Adjustment

$color
Independently scales the red, green and blue channels of an albedo.

Transparency

$alpha
Scales the opacity of an entire material.
$alphatest
Specifies a mask to use to determine binary opacity.
$translucent
Specifies that the material should be partially see-through.

Effect

$nofog
Prevents fog from overdrawing a material.

Additional Parameters

$receiveflashlight <boolean>
Allow the player's flashlight to illuminate the material.
$singlepassflashlight <boolean>
Possibly used to allow shadows to form from this decal. For example, found in L4D2 decals/detail/ruraldetailsprites.vmt To do: confirm.

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.