VertexLitGeneric: Difference between revisions
		
		
		
		
		
		Jump to navigation
		Jump to search
		
				
		
		
	
No edit summary  | 
				Deprecated (talk | contribs)   (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|$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 ===  | ||
;<code>[[$color#Models|$color2]]</code>  | ;<code>[[$color#Models|$color2]]</code>  | ||
: Color tinting.  | : Color tinting.  | ||
;{{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}}}}  | ||
=== Transparency ===  | === Transparency ===  | ||
;{{ent|$alpha}}  | ;{{ent|$alpha}}  | ||
:   | : Cheaply scales the opacity of an entire material.  | ||
;{{ent|$alphatest}}  | ;{{ent|$alphatest}}  | ||
:   | : Cheap transparency using a binary opacity mask.  | ||
;{{ent|$nocull}}  | ;{{ent|$nocull}}  | ||
: Disables backface culling.  | : Disables backface culling.  | ||
;{{ent|$translucent}}  | ;{{ent|$translucent}}  | ||
:   | : 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|$halflambert}}  | ;{{ent|$halflambert}}  | ||
: Half-lambertian shading.  | : Half-lambertian shading.  | ||
;{{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 22:29, 12 January 2022
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.
 
- $decaltexture (only in 
) - Use a 2nd UV channel for high-resolution decal support.
 
Adjustment
$color2- Color tinting.
 - $lightwarptexture (in all games since 
) - 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 
) - 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 
) - Advanced flowing self-illumination, used on the Vortigaunts in Template:Game link.
 
Reflection
- $envmap
 - Specular reflections.
 - $phong (in all games since 
) - Diffuse reflections.
 - $rimlight (in all games since 
) - Constant rimlight based on phong and the ambient lighting.
 
Effect
$compress(in all games since
)$stretch(in all games since
)- Wrinklemaps for character faces.
 - $flesh (in all games since 
) - The flesh effect used for Alyx in Half-Life 2: Episode Two.
 - $treeSway (in all games since 
) - 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 Template:Game link. 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
- Materials for models
 - EyeRefract, the shader for modeled eyes.
 - Teeth, the shader for modeled teeth.