This article's documentation is for anything that uses the Source engine. Click here for more information.

$halflambert: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
Tag: Reverted
(Eh, I'll add workarounds to the %alphatexture page instead)
Tag: Manual revert
 
Line 8: Line 8:
{{important|Not designed for static props:
{{important|Not designed for static props:
* Does not work on [[static prop]]s which have lighting baked [[VHV|per-vertex]] or [[PPL|into lightmaps]] in stock [[VRAD]]; this could be achieved with a custom VRAD.
* Does not work on [[static prop]]s which have lighting baked [[VHV|per-vertex]] or [[PPL|into lightmaps]] in stock [[VRAD]]; this could be achieved with a custom VRAD.
* Shadows cast by static props will always be full-lambertian. This could potentially be worked around by using an {{cmd|%alphatexture}}{{gmod|only}} with half opacity.
* Shadows cast by static props will always be full-lambertian. This could potentially be worked around by using an {{cmd|%alphatexture}} with half opacity.
}}
}}



Latest revision as of 11:14, 9 April 2025

English (en)Translate (Translate)
Lambertian (left) and Half Lambertian (right)

$halflambert is a material shader parameter for the VertexLitGeneric, Teeth, EyeRefract, VortWarp, and Infected (shader) shader available in all Source Source games. It is a boolean parameter that enables half-lambertian lighting, which wraps lighting further around a model to prevent it from losing definition. It only works on models.

Icon-Important.pngImportant:In stock shaders for Source 2007 to Portal 2 engine branch, half-lambertian lighting is forcibly enabled on VertexLitGeneric regardless of $halflambert setting when $phong is enabled, unless $phongdisablehalflambert(in all games since Alien Swarm) is enabled.
Note.pngNote:This parameter is forcibly disabled since Counter-Strike: Global Offensive due to conflicts with cascade shadow mapping.
Icon-Important.pngImportant:Not designed for static props:
  • Does not work on static props which have lighting baked per-vertex or into lightmaps in stock VRAD; this could be achieved with a custom VRAD.
  • Shadows cast by static props will always be full-lambertian. This could potentially be worked around by using an %alphatexture with half opacity.

Syntax

$halflambert 1