VertexLitGeneric: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Rewrite to provide details for parameters, added misc parameters, remove stub category)
(Changed to use Shader, MatParam, and ent templates where applicable, added game add information, added misc CSGO parameters)
Line 1: Line 1:
'''<code>VertexLitGeneric</code>''' is a [[material]] [[shader]] most commonly used to render [[model]]s.
{{Shader|VertexLitGeneric}} It is the shader most commonly used to render [[models]], and supports a variety of effects.


== Supported Parameters ==
== Supported Parameters ==


;<code>[[$bumpmap]]</code>
;{{ent|$bumpmap}}
: Bumpmapping.
: Bumpmapping.
;<code>[[$color#Models|$color2]]</code>
;<code>[[$color#Models|$color2]]</code>
: Color tinting.
: Color tinting.
;<code>[[$detail]]</code>
;{{ent|$detail}}
: Detail texturing.
: Detail texturing.
;<code>[[$envmap]]</code>
;{{ent|$envmap}}
: Specular reflections.
: Specular reflections.
;<code>[[$emissiveblend]]</code>
;{{ent|$emissiveblend}} {{EP2 add}}
: Advanced flowing self-illumination, used on the Vortigaunts in Episode 2.
: Advanced flowing self-illumination, used on the Vortigaunts in {{Game link|Half-Life 2: Episode Two}}
;<code>[[$flesh]]</code>
;{{ent|$flesh}} {{EP2 add}}
: The flesh effect used for Alyx in Episode 2.
: The flesh effect used for Alyx in Half-Life 2: Episode Two.
;<code>[[$halflambert]]</code>
;{{ent|$halflambert}}
: Half-lambertian shading.
: Half-lambertian shading.
;<code>[[$lightwarptexture]]</code>
;{{ent|$lightwarptexture}} {{EP1 add}}
: Per-texel color modification via a warp texture.
: Per-texel color modification via a warp texture.
;<code>[[$phong]]</code>
;{{ent|$phong}} {{EP1 add}}
: Diffuse reflections.
: Diffuse reflections.
;<code>[[$rimlight]]</code>
;{{ent|$rimlight}} {{EP2 add}}
: Constant rimlight based on phong and the ambient lighting.
: Constant rimlight based on phong and the ambient lighting.
;<code>[[$selfillum]]</code>
;{{ent|$selfillum}}
: Self-illumination.
: Self-illumination.
;<code>[[$translucent]]</code>
;{{ent|$translucent}}
;<code>[[$alpha]]</code>
;{{ent|$alpha}}
: Expensive and cheap transparency.
: Expensive and cheap transparency.
;<code>[[Wrinkle_maps#Materials_and_textures|$compress]]</code>
;<code>[[Wrinkle_maps#Materials_and_textures|$compress]]</code> {{EP2 add}}
;<code>[[Wrinkle_maps#Materials_and_textures|$stretch]]</code>
;<code>[[Wrinkle_maps#Materials_and_textures|$stretch]]</code> {{EP2 add}}
: Wrinklemaps for character faces.
: Wrinklemaps for character faces.
;<code>[[$treeSway]]</code>
;{{ent|$treeSway}} {{L4D add}}
: Vertex manipulation to give the effect of trees swaying in the wind.
: Vertex manipulation to give the effect of trees swaying in the wind.


===Misc Parameters===
===Misc Parameters===


;<code>$desaturatewithbasealpha <[[float]]></code> {{AS add}}
{{MatParam|$desaturatewithbasealpha|float|Use the base alpha to desaturate the base texture. Set to non-zero to enable, value gets multiplied into the alpha channel before desaturating.|since=AS}}
: Use the base alpha to desaturate the base texture. Set to non-zero to enable, value gets multiplied into the alpha channel before desaturating.
{{MatParam|$flashlightnolambert|bool|{{todo|''Flashlight pass sets N.L{{=}}1.0''}}}}
;<code>$flashlightnolambert <[[bool]]></code>
{{MatParam|$seperatedetailuvs|bool|{{todo|''Use texcoord1 for detail texture''}}}}
: {{todo|''Flashlight pass sets N.L{{=}}1.0''}}
{{MatParam|$allowfencerenderstatehack|bool|Fence render hack for cascade shadow maps, allows shadow maps to work properly with fences.|since=CSGO}}
;<code>$seperatedetailuvs <bool></code>
{{MatParam|$disablecsmlookup|bool|Disable cascade shadow map lookup/filtering, useful on dense foilage.|since=CSGO}}
: {{todo|''Use texcoord1 for detail texture''}}


=== Cloak ===
=== Cloak ===


VertexLitGeneric natively supports the Spy cloak effect from [[Team Fortress 2]]. You will want to combine it with a sine wave [[Material Proxies|proxy]] for the full effect.
<code>VertexLitGeneric</code> natively supports the Spy cloak effect from {{Game link|Team Fortress 2}}. You will want to combine it with a sine wave [[Material Proxies|proxy]] for the full effect.


; <code>$cloakpassenabled <[[bool]]></code>
{{MatParam|$cloakpassenabled|bool|Enables cloaking effects.}}
: Enables cloaking effects.
{{MatParam|$cloakfactor|normal|0 {{=}} fully visible, 1 {{=}} fully invisible.}}
; <code>$cloakfactor <[[normal]]></code>
{{MatParam|$cloakcolortint|RGB matrix|Colors the refraction effect. Default is white.}}
: 0 = fully visible, 1 = fully invisible.
{{MatParam|$refractamount|float|How strong the refraction effect should be when the material is partially cloaked. Default 2.}}
; <code>$cloakcolortint <[[RGB]] matrix></code>
: Colours the refraction effect. Default is white.
; <code>$refractamount <[[float]]></code>
: How strong the refraction effect should be when the material is partially cloaked (default = 2).


=== See also ===
=== See also ===
* [[Materials_for_models#Compiling_your.VMT_:_Valve_Material_Type|Materials for models]]
* [[Materials_for_models#Compiling_your.VMT_:_Valve_Material_Type|Materials for models]]
*<code>[[EyeRefract]]</code>, the shader for modeled eyes.
*{{ent|EyeRefract}}, the shader for modeled eyes.
*<code>[[Teeth]]</code>, the shader for modeled teeth.
*{{ent|Teeth}}, the shader for modeled teeth.
 
[[Category:Shaders]]

Revision as of 11:56, 27 June 2019

Shader-ball.png VertexLitGeneric It is the shader most commonly used to render models, and supports a variety of effects.

Supported Parameters

$bumpmap
Bumpmapping.
$color2
Color tinting.
$detail
Detail texturing.
$envmap
Specular reflections.
$emissiveblend Template:EP2 add
Advanced flowing self-illumination, used on the Vortigaunts in Half-Life 2: Episode Two Half-Life 2: Episode Two
$flesh Template:EP2 add
The flesh effect used for Alyx in Half-Life 2: Episode Two.
$halflambert
Half-lambertian shading.
$lightwarptexture (in all games since Half-Life 2: Episode One)
Per-texel color modification via a warp texture.
$phong (in all games since Half-Life 2: Episode One)
Diffuse reflections.
$rimlight Template:EP2 add
Constant rimlight based on phong and the ambient lighting.
$selfillum
Self-illumination.
$translucent
$alpha
Expensive and cheap transparency.
$compress Template:EP2 add
$stretch Template:EP2 add
Wrinklemaps for character faces.
$treeSway Template:L4D add
Vertex manipulation to give the effect of trees swaying in the wind.

Misc Parameters

$desaturatewithbasealpha $flashlightnolambert $seperatedetailuvs $allowfencerenderstatehack $disablecsmlookup

Cloak

VertexLitGeneric natively supports the Spy cloak effect from Team Fortress 2 Team Fortress 2 . You will want to combine it with a sine wave proxy for the full effect.

$cloakpassenabled $cloakfactor $cloakcolortint $refractamount

See also