VertexLitGeneric: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
(Re-ordered parameters based on engine addition dates)
Line 7: Line 7:
;{{ent|$basetexture}}
;{{ent|$basetexture}}
: Defines an albedo texture.
: Defines an albedo texture.
; {{ent|$decaltexture}} {{only|{{csgo}}}}
: Use a 2nd UV channel for high-resolution decal support.
;{{ent|$detail}}
;{{ent|$detail}}
: Detail texturing.
: Detail texturing.
{{MatParam|$seperatedetailuvs|bool|{{todo|''Use texcoord1 for detail texture''}}|since={{src07}}}}
{{MatParam|$seperatedetailuvs|bool|{{todo|''Use texcoord1 for detail texture''}}|since={{src07}}}}
; {{ent|$decaltexture}} {{only|{{csgo}}}}
: Use a 2nd UV channel for high-resolution decal support.


=== Adjustment ===
=== 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>
;<code>[[$color#Models|$color2]]</code>
: Color tinting.
: 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}}}}
;{{ent|$lightwarptexture}} {{since|{{src06}}}}
: Per-texel color modification via a warp texture.
: Per-texel color modification via a warp texture.
{{MatParam|[[$allowdiffusemodulation]]|bool|Prevents the model's material from being tinted by <code>$color2</code> or <code>rendercolor.</code>|since={{l4d}}}}
{{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|[[$notint]]|bool|Prevents the model's material from being tinted by <code>$color2</code> or <code>rendercolor.</code>|only={{csgo}}|also={{P2CE}}}}
{{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 ===
=== Transparency ===
{{MatParam|$allowfencerenderstatehack|bool|Fence render hack for cascade shadow maps, allows shadow maps to work properly with fences.|since={{csgo}}}}
;{{ent|$alpha}}
;{{ent|$alpha}}
: Scales the opacity of an entire material.
: Cheaply scales the opacity of an entire material.
;{{ent|$alphatest}}
;{{ent|$alphatest}}
: Specifies a mask to use to determine binary opacity.
: Cheap transparency using a binary opacity mask.
{{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}}
;{{ent|$nocull}}
: Disables backface culling.
: Disables backface culling.
;{{ent|$translucent}}
;{{ent|$translucent}}
: Specifies that the material should be partially see-through.
: Expensive translucency using a full alpha mask.
;{{ent|$distancealpha}} {{since|{{src07}}}}
: Vector-like edge filtering.


=== Lighting ===
=== Lighting ===
;{{ent|$bumpmap}}
;{{ent|$bumpmap}}
: Normal mapping.
: Normal mapping.
;{{ent|$emissiveblend}} {{since|{{src07}}}}
: Advanced flowing self-illumination, used on the Vortigaunts in {{Game link|Half-Life 2: Episode Two}}.
{{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}}}}
;{{ent|$halflambert}}
;{{ent|$halflambert}}
: Half-lambertian shading.
: Half-lambertian shading.
{{MatParam|$lowqualityflashlightshadows|bool|Force low quality flashlight/projected texture shadows for faster performance.|since={{portal2}}}}
;{{ent|$selfillum}}
;{{ent|$selfillum}}
: Determines whether the surface is self-illuminated independent of environment lighting.
: Determines whether the surface is self-illuminated independent of environment lighting.
;{{ent|$emissiveblend}} {{since|{{src07}}}}
: Advanced flowing self-illumination, used on the Vortigaunts in {{Game link|Half-Life 2: Episode Two}}.


=== Reflection ===
=== Reflection ===
Line 60: Line 53:


=== Effect ===
=== Effect ===
;<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|$flesh}} {{since|{{src07}}}}
;{{ent|$flesh}} {{since|{{src07}}}}
: The flesh effect used for Alyx in Half-Life 2: Episode Two.
: The flesh effect used for Alyx in Half-Life 2: Episode Two.
;{{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.
=== Technical Workarounds ===
{{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|$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}}}}


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

Revision as of 23:29, 12 January 2022

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.
$detail
Detail texturing.

$seperatedetailuvs

$decaltexture (only in Counter-Strike: Global Offensive)
Use a 2nd UV channel for high-resolution decal support.

Adjustment

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

[[$allowdiffusemodulation|$allowdiffusemodulation]] $desaturatewithbasealpha [[$notint|$notint]]

Transparency

$alpha
Cheaply scales the opacity of an entire material.
$alphatest
Cheap transparency using a binary opacity mask.
$nocull
Disables backface culling.
$translucent
Expensive translucency using a full alpha mask.
$distancealpha (in all games since Source 2007)
Vector-like edge filtering.

Lighting

$bumpmap
Normal mapping.
$halflambert
Half-lambertian shading.
$selfillum
Determines whether the surface is self-illuminated independent of environment lighting.
$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 .

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

$compress (in all games since Source 2007)
$stretch (in all games since Source 2007)
Wrinklemaps for character faces.
$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.

Technical Workarounds

$flashlightnolambert $lowqualityflashlightshadows $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

Caveats

Mapbase

Unlit materials in Mapbase should have the shader SDK_VertexLitGeneric.

See also