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

$nocull: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
m (Replacing with "This is a" template)
 
(13 intermediate revisions by 11 users not shown)
Line 1: Line 1:
{{otherlang2
{{LanguageBar}}
|fr=$nocull:fr
}}
Makes the material appear on the reverse side of the surface it is applied to. Generally only useful when used in conjunction with <code>[[$translucent]]</code> or <code>[[$alpha]]</code>.


$nocull 1
{{This is a|shader parameter|name=$nocull}} It disables backface culling, resulting in triangles showing from both sides. It is used to allow for infinitely thin dual sided objects without duplicating the triangles with reversed vertex order. Lighting will still only be calculated from the "front" side of the face, and be copied to the reverse side, potentially creating an effect where light bleeds through to the other side like a thin sheet hung up in direct sunlight, so use with caution.


{{note|Has no effect on [[world brush]]es (so tie each one to [[func_detail]]).}}
{{note|Has no effect on [[world brush]]es (so tie each one to [[func_detail]]). Works on displacements.{{modernConfirm|Seems to ''only'' work on func_detail.}}}}


{{bug|Cannot be used with <code>$translucent</code> on [[model]]s. Use <code>[[$alphatest]]</code> instead.}}
{{bug|Cannot be used with {{mono|[[$translucent]]}} on [[model]]s. Use {{mono|[[$alphatest]]}} instead.{{modernConfirm|Does it work with {{mono|[[$alpha]]}}? }}}}


[[Category:List of Shader Parameters|N]]
==VMT Syntax and Examples==
[[Category:English]]
 
$nocull <[[bool]]>
 
[[LightmappedGeneric]]
{
[[$basetexture]] glass\window001a
'''$nocull 1'''
}
 
[[VertexLitGeneric]]
{
[[$basetexture]] models\items\medkit
'''$nocull 1'''
}
 
[[VertexLitGeneric]]
{
[[$basetexture]] models\props_2fort\blue_window001_glass
[[$alphatest]] 1
'''$nocull 1'''
}[[Category:Shader parameters|n]]

Latest revision as of 10:00, 10 August 2024

English (en)Français (fr)Translate (Translate)

$nocull is a material shader parameter available in all Source Source games. It disables backface culling, resulting in triangles showing from both sides. It is used to allow for infinitely thin dual sided objects without duplicating the triangles with reversed vertex order. Lighting will still only be calculated from the "front" side of the face, and be copied to the reverse side, potentially creating an effect where light bleeds through to the other side like a thin sheet hung up in direct sunlight, so use with caution.

Note.pngNote:Has no effect on world brushes (so tie each one to func_detail). Works on displacements.
Confirm:Seems to only work on func_detail.
Icon-Bug.pngBug:Cannot be used with $translucent on models. Use $alphatest instead.
Confirm:Does it work with $alpha?
  [todo tested in ?]

VMT Syntax and Examples

$nocull <bool>
LightmappedGeneric
{
	$basetexture glass\window001a
	$nocull 1
}
VertexLitGeneric
{
	$basetexture models\items\medkit
	$nocull 1
}
VertexLitGeneric
{
	$basetexture models\props_2fort\blue_window001_glass
	$alphatest 1
	$nocull 1
}