UnlitGeneric: Difference between revisions
ReverendV92 (talk | contribs) (Minor grammar/formatting fixes) |
No edit summary |
||
(35 intermediate revisions by 10 users not shown) | |||
Line 1: | Line 1: | ||
{{LanguageBar}} | |||
{{ | '''{{code|UnlitGeneric}}''' draws a [[diffuse]] 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). | ||
== | == Supported Parameters == | ||
=== Basics === | |||
{{MatParamDef|$basetexture|texture|Defines a diffuse texture.}} | |||
{{MatParamDef|$surfaceprop|string|Links the [[$surfaceprop|surface]] to a set of physical properties.}} | |||
{{MatParamDef|$model|bool|Tells this material is used for [[3D Model|models]] and not [[Brush|brushes]].}} | |||
== | === Adjustment === | ||
{{MatParamDef|$detail|Texture|Multitexturing.}} | |||
{{MatParamDef|$color|RGB matrix|Independently scales the red, green and blue channels of an albedo.}} | |||
=== Transparency === | |||
{{MatParamDef|$alpha|normal|Scales the opacity of an entire material.}} | |||
{{MatParamDef|$alphatest|bool|Specifies a mask to use to determine binary opacity.}} | |||
{{MatParamDef|$nocull|bool|Disables backface culling, resulting in triangles showing from both sides.}} | |||
{{MatParamDef|$translucent|bool|Specifies that the material should be partially see-through.}} | |||
{{MatParamDef|$vertexalpha|bool|Per-vertex translucency on [[displacement]]s}} | |||
== | === Texture Organization === | ||
{{MatParamDef|%keywords|string|Sets a keyword filter that can be filtered in hammer for easier texture finding.}} | |||
{{MatParamDef|%notooltexture|bool|Hides the material from Hammer's texture browser.}} | |||
{{MatParamDef|%tooltexture|texture|Used to blend texture previews in [[Hammer]].}} | |||
=== Effect === | |||
{{MatParamDef|$nofog|bool|Prevents fog from overdrawing a material.}} | |||
== Additional Parameters == | |||
{{MatParamDef|$linearwrite|bool|Instructs the System that the Shader writes Linear Values that require conversion, or sRGB Values that don't require conversion. | |||
The Parameter Name is a tad confusing. A Value of 0 means the Shader outputs Linear Values. A Value of 1 means the output shouldn't be converted.}} | |||
{{MatParamDef|$receiveflashlight|bool|Allow the player's flashlight to illuminate the material.}} | |||
{{MatParamDef|$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.}}}} | |||
{{MatParamDef|$deferred|bool|only={{lw}}|{{confirm|Enables/disables deferred lighting on this material?}}}} | |||
== Caveats == | |||
=== Projected Texture Bugs === | |||
If a [[Skybox]] has an '''{{code|UnlitGeneric}}''' shader applied to it, some visual bugs can occur. Notably, if a projected texture is shone near a Skybox using an '''{{code|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]] exists in the world, typically in its own box which exists outside of the rest of the map. | |||
Preferably, use the purpose-built '''{{code|[[Sky_(shader)|Sky]]}}''' shader instead. | |||
=== Models === | |||
If this shader is being used on a [[model]], you must specify {{code|[[$model_(VMT)|$model 1]]}} to prevent errors. | |||
=== Mapbase === | |||
Unlit materials in [[Mapbase]] should have the shader '''{{code|SDK_UnlitGeneric}}'''. | |||
[[Category:Shaders]] | [[Category:Shaders]] | ||
[[Category:Stubs]] | [[Category:Stubs]] |
Latest revision as of 11:38, 23 August 2025
UnlitGeneric draws a diffuse 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
Adjustment
Transparency
Texture Organization
Effect
Additional Parameters
For example, found in L4D2 decals/detail/ruraldetailsprites.vmt
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 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 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.