VertexLitGeneric: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
Line 4: Line 4:
== Supported Parameters ==
== Supported Parameters ==


;{{ent|$bumpmap}}
=== Basics ===
: Normal mapping.
;{{ent|$basetexture}}
;<code>[[$color#Models|$color2]]</code>
: Defines an albedo texture.
: Color tinting.
; {{ent|$decaltexture}} {{only|{{csgo}}}}
; {{ent|$decaltexture}} {{only|{{csgo}}}}
: Use a 2nd UV channel for high-resolution decal support.
: Use a 2nd UV channel for high-resolution decal support.
;{{ent|$detail}}
;{{ent|$detail}}
: Detail texturing.
: Detail texturing.
;{{ent|$envmap}}
{{MatParam|$seperatedetailuvs|bool|{{todo|''Use texcoord1 for detail texture''}}|since={{src07}}}}
: Specular reflections.
 
=== Adjustment ===
{{MatParam|[[$allowdiffusemodulation]]|bool|Prevents the model's material from being tinted by <code>$color2</code> or <code>rendercolor.</code>|since={{l4d}}}}
;<code>[[$color#Models|$color2]]</code>
: Color tinting.
{{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}}}}
;{{ent|$lightwarptexture}} {{since|{{src06}}}}
: Per-texel color modification via a warp texture.
{{MatParam|[[$notint]]|bool|Prevents the model's material from being tinted by <code>$color2</code> or <code>rendercolor.</code>|only={{csgo}}|also={{P2CE}}}}
;<code>[[Wrinkle_maps#Materials_and_textures|$compress]]</code> {{since|{{src07}}}}
;<code>[[Wrinkle_maps#Materials_and_textures|$stretch]]</code> {{since|{{src07}}}}
: Wrinklemaps for character faces.
 
=== Transparency ===
{{MatParam|$allowfencerenderstatehack|bool|Fence render hack for cascade shadow maps, allows shadow maps to work properly with fences.|since={{csgo}}}}
;{{ent|$alpha}}
: Scales the opacity of an entire material.
;{{ent|$alphatest}}
: Specifies a mask to use to determine binary opacity.
{{MatParam|$disablecsmlookup|bool|Disable cascade shadow map lookup/filtering, useful on dense foilage.|since={{csgo}}}}
;{{ent|$distancealpha}} {{since|{{src07}}}}
: Vector-like edge filtering.
;{{ent|$nocull}}
: Disables backface culling.
;{{ent|$translucent}}
: Specifies that the material should be partially see-through.
 
=== Lighting ===
;{{ent|$bumpmap}}
: Normal mapping.
;{{ent|$emissiveblend}} {{since|{{src07}}}}
;{{ent|$emissiveblend}} {{since|{{src07}}}}
: Advanced flowing self-illumination, used on the Vortigaunts in {{Game link|Half-Life 2: Episode Two}}.
: Advanced flowing self-illumination, used on the Vortigaunts in {{Game link|Half-Life 2: Episode Two}}.
;{{ent|$flesh}} {{since|{{src07}}}}
{{MatParam|$flashlightnolambert|bool|Tell [[env_projectedtexture|projected textures]] such as the flashlight to ignore the surface normal of the model. Useful for models with {{ent|$nocull}} such as foilage. Otherwise, lighting the face with a flashlight from behind will not affect it. Default 0.|since={{src07}}}}
: The flesh effect used for Alyx in Half-Life 2: Episode Two.
;{{ent|$halflambert}}
;{{ent|$halflambert}}
: Half-lambertian shading.
: Half-lambertian shading.
;{{ent|$lightwarptexture}} {{since|{{src06}}}}
{{MatParam|$lowqualityflashlightshadows|bool|Force low quality flashlight/projected texture shadows for faster performance.|since={{portal2}}}}
: Per-texel color modification via a warp texture.
;{{ent|$selfillum}}
: Determines whether the surface is self-illuminated independent of environment lighting.
 
=== Reflection ===
;{{ent|$envmap}}
: Specular reflections.
;{{ent|$phong}} {{since|{{src06}}}}
;{{ent|$phong}} {{since|{{src06}}}}
: Diffuse reflections.
: Diffuse reflections.
;{{ent|$rimlight}} {{since|{{src07}}}}
;{{ent|$rimlight}} {{since|{{src07}}}}
: Constant rimlight based on phong and the ambient lighting.
: Constant rimlight based on phong and the ambient lighting.
;{{ent|$selfillum}}
 
: Self-illumination.
=== Effect ===
;{{ent|$translucent}}
;{{ent|$flesh}} {{since|{{src07}}}}
;{{ent|$alpha}}
: The flesh effect used for Alyx in Half-Life 2: Episode Two.
: Expensive and cheap transparency.
;<code>[[Wrinkle_maps#Materials_and_textures|$compress]]</code> {{since|{{src07}}}}
;<code>[[Wrinkle_maps#Materials_and_textures|$stretch]]</code> {{since|{{src07}}}}
: Wrinklemaps for character faces.
;{{ent|$treeSway}} {{since|{{l4d}}}}
;{{ent|$treeSway}} {{since|{{l4d}}}}
: 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===
{{MatParam|$flashlightnolambert|bool|Tell [[env_projectedtexture|projected textures]] such as the flashlight to ignore the surface normal of the model. Useful for models with {{ent|$nocull}} such as foilage. Otherwise, lighting the face with a flashlight from behind will not affect it. Default 0.|since={{src07}}}}
{{MatParam|$seperatedetailuvs|bool|{{todo|''Use texcoord1 for detail texture''}}|since={{src07}}}}
{{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}}}}
{{MatParam|$lowqualityflashlightshadows|bool|Force low quality flashlight/projected texture shadows for faster performance.|since={{portal2}}}}
{{MatParam|$allowfencerenderstatehack|bool|Fence render hack for cascade shadow maps, allows shadow maps to work properly with fences.|since={{csgo}}}}
{{MatParam|$disablecsmlookup|bool|Disable cascade shadow map lookup/filtering, useful on dense foilage.|since={{csgo}}}}
{{MatParam|[[$allowdiffusemodulation]]|bool|Prevents the model's material from being tinted by <code>$color2</code> or <code>rendercolor.</code>|since={{l4d}}}}
{{MatParam|[[$notint]]|bool|Prevents the model's material from being tinted by <code>$color2</code> or <code>rendercolor.</code>|only={{csgo}}|also={{P2CE}}}}


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

Revision as of 08:01, 16 October 2021

English (en)Français (fr)中文 (zh)Translate (Translate)

VertexLitGeneric is a material shader available in all Source games. It is the shader most commonly used to render models, and supports a variety of effects.

Supported Parameters

Basics

$basetexture
Defines an albedo texture.
$decaltexture (only in Counter-Strike: Global Offensive)
Use a 2nd UV channel for high-resolution decal support.
$detail
Detail texturing.

$seperatedetailuvs

Adjustment

[[$allowdiffusemodulation|$allowdiffusemodulation]]

$color2
Color tinting.

$desaturatewithbasealpha

$lightwarptexture (in all games since Source 2006)
Per-texel color modification via a warp texture.

[[$notint|$notint]]

$compress (in all games since Source 2007)
$stretch (in all games since Source 2007)
Wrinklemaps for character faces.

Transparency

$allowfencerenderstatehack

$alpha
Scales the opacity of an entire material.
$alphatest
Specifies a mask to use to determine binary opacity.

$disablecsmlookup

$distancealpha (in all games since Source 2007)
Vector-like edge filtering.
$nocull
Disables backface culling.
$translucent
Specifies that the material should be partially see-through.

Lighting

$bumpmap
Normal mapping.
$emissiveblend (in all games since Source 2007)
Advanced flowing self-illumination, used on the Vortigaunts in Half-Life 2: Episode Two Half-Life 2: Episode Two .

$flashlightnolambert

$halflambert
Half-lambertian shading.

$lowqualityflashlightshadows

$selfillum
Determines whether the surface is self-illuminated independent of environment lighting.

Reflection

$envmap
Specular reflections.
$phong (in all games since Source 2006)
Diffuse reflections.
$rimlight (in all games since Source 2007)
Constant rimlight based on phong and the ambient lighting.

Effect

$flesh (in all games since Source 2007)
The flesh effect used for Alyx in Half-Life 2: Episode Two.
$treeSway (in all games since Left 4 Dead)
Vertex manipulation to give the effect of trees swaying in the wind.

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