VertexLitGeneric: Difference between revisions
Peterscraps (talk | contribs) mNo edit summary |
(Improves VertexLitGeneric's material parameters readability) |
||
Line 5: | Line 5: | ||
=== Basics === | === Basics === | ||
{{MatParam|$basetexture|texture|[[$basetexture]] defines [[albedo]] texture.}} | |||
{{MatParam|$detail|texture|[[$detail|Detail]] texturing.}} | |||
{{MatParam|$decaltexture|texture|Use a 2nd UV channel for high-resolution decal support.|only={{csgo}}}} | |||
{{MatParam|$ | |||
=== Adjustment === | === Adjustment === | ||
{{MatParam|$color2|RGB matrix|[[$color#Models|Color tinting]].}} | |||
{{MatParam|$basetexturetransform|matrix|[[$basetexture#.24basetexturetransform|Transform]] [[$basetexture]]'s alignment, scale, rotation and position.}} | |||
{{MatParam|[[$allowdiffusemodulation]]|bool|Prevents the model's material from being tinted by [[$color2]] or <code>rendercolor.</code>|since={{l4d}}}} | |||
{{MatParam|$seperatedetailuvs|bool|{{todo|''Confirm use of texcoord1 for [[$detail|detail]] texture''}}|since={{src07}}}} | |||
{{MatParam|[[$allowdiffusemodulation]]|bool|Prevents the model's material from being tinted by | |||
{{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|$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 | {{MatParam|[[$notint]]|bool|Prevents the model's material from being tinted by [[$color2]] or <code>rendercolor.</code>|only={{csgo}}|also={{P2CE}}}} | ||
=== Transparency === | === Transparency === | ||
{{MatParam|$alpha|bool|Cheaply scales the opacity of an entire material.}} | |||
{{MatParam|$alphatest|bool|Cheap transparency using a binary opacity mask.}} | |||
{{MatParam|$nocull|bool|Disables backface culling.}} | |||
{{MatParam|$translucent|bool|Expensive translucency using a full alpha mask.}} | |||
{{MatParam|$distancealpha}}|bool|{{since|{{src07}}Vector-like edge filtering.}} | |||
=== Lighting === | === Lighting === | ||
{{MatParam|$bumpmap|texture| [[Bump_map|Bump]] diffuse. [[Normal]] mapping.}} | |||
{{MatParam|$lightwarptexture|texture|1 dimension Per-texel color modification via a [[$lightwarptexture|warp texture]].|since={{src06}}}} | |||
{{MatParam|$halflambert|bool|[[$halflambert|Half-lambertian]] shading.}} | |||
{{MatParam|$selfillum|bool|Determines whether the surface is [[Glowing_Textures#.24selfillum|self-illuminated]] independent of environment lighting.}} | |||
{{MatParam|$emissiveblendenabled|bool|[[Glowing_Textures#.24emissiveblend|Advanced flowing self-illumination]], used on the [[Vortigaunt|Vortigaunts]] in {{Game link|Half-Life 2: Episode Two}}.|since={{src07}}}} | |||
=== Reflection === | === Reflection === | ||
{{MatParam|$envmap|texture|[[$envmap|Specular reflections]].}} | |||
{{MatParam|$phong|bool|[[$phong|Diffuse reflections]].|since={{src06}}}} | |||
{{MatParam|$rimlight|bool|Constant [[$rimlight|rimlight]] based on [[phong]] and the ambient lighting.|since={{src07}}}} | |||
=== Effect === | === Effect === | ||
{{MatParam|$compress|texture|[[Wrinkle_maps#Materials_and_textures|Wrinklemaps]] for character faces.|since={{src07}}}} | |||
{{MatParam|$stretch|texture|[[Wrinkle_maps#Materials_and_textures|Wrinklemaps]] for character faces.|since={{src07}}}} | |||
{{MatParam|$flesh|bool|The [[$flesh|flesh]] effect used for Alyx in Half-Life 2: Episode Two.|since={{src07}}}} | |||
{{MatParam|$treeSway|bool|Vertex manipulation to give the effect of [[$treeSway|trees swaying]] in the wind.|since={{l4d}}}} | |||
=== Technical Workarounds === | === 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|$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|$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|$allowfencerenderstatehack|bool|Fence render hack for cascade shadow maps, allows shadow maps to work properly with fences.|since={{csgo}}}} | ||
Line 72: | Line 53: | ||
{{MatParam|$cloakpassenabled|bool|Enables cloaking effects.}} | {{MatParam|$cloakpassenabled|bool|Enables cloaking effects.}} | ||
{{MatParam|$cloakfactor|normal|0.00 {{=}} fully visible, 1.00 {{=}} fully invisible.}} | {{MatParam|$cloakfactor|normal|0.00 {{=}} fully visible,<br/> | ||
{{MatParam|$cloakcolortint|RGB matrix|Colors the refraction effect. Default | 1.00 {{=}} fully invisible.}} | ||
{{MatParam|$refractamount|float|How strong the refraction effect should be when the material is partially cloaked. Default 2.}} | {{MatParam|$cloakcolortint|RGB matrix|Colors the refraction effect. ''Default " [ 1 1 1 ] "''.}} | ||
{{MatParam|$refractamount|float|How strong the refraction effect should be when the material is partially cloaked. ''Default 2''.}} | |||
== Caveats == | == Caveats == |
Revision as of 00:51, 21 March 2023
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
$detail
$decaltexture
Adjustment
$color2
$basetexturetransform
[[$allowdiffusemodulation|$allowdiffusemodulation]]
$seperatedetailuvs
$desaturatewithbasealpha
[[$notint|$notint]]
Transparency
$alpha
$alphatest
$nocull
$translucent
$distancealpha
|bool|(in all games since Vector-like edge filtering.)
Lighting
$bumpmap
$lightwarptexture
$halflambert
$selfillum
$emissiveblendenabled
Reflection
Effect
$compress
$stretch
$flesh
$treeSway
Technical Workarounds
$flashlightnolambert
$lowqualityflashlightshadows
$allowfencerenderstatehack
$disablecsmlookup
Cloak
VertexLitGeneric
natively supports the Spy cloak effect from 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
- Materials for models
- EyeRefract, the shader for modeled eyes.
- Teeth, the shader for modeled teeth.