Zh/VertexLitGeneric: Difference between revisions
(Created page with "{{subst:#if: Translation of 'VertexLitGeneric' to '中文' via Template:LanguageBar buttons * * * * * * * * * * * * * * * * * * * * * * * * * * * *...") |
No edit summary |
||
Line 1: | Line 1: | ||
{{wip}}{{translating}} | |||
{{LanguageBar}}{{this is a|vertex shader|name=VertexLitGeneric}} It is the shader most commonly used to render {{L|models}}, and supports a variety of effects. Do not use this on world geometry, else you may encounter lighting bugs. | |||
{{LanguageBar}}{{this is a|vertex shader|name=VertexLitGeneric}} It is the shader most commonly used to render | |||
== Supported Parameters == | == Supported Parameters == | ||
=== Basics === | === Basics === | ||
{{MatParam|$basetexture|texture| | {{MatParam|$basetexture|texture|{{L|$basetexture}} defines {{L|diffuse}} texture.}} | ||
{{MatParam|$detail|texture| | {{MatParam|$detail|texture|{{L|$detail|Detail}} texturing.}} | ||
{{MatParam|$decaltexture|texture|Use a 2nd UV channel for high-resolution decal support.|only={{csgo}}}} | {{MatParam|$decaltexture|texture|Use a 2nd UV channel for high-resolution decal support.|only={{csgo}}}} | ||
=== Adjustment === | === Adjustment === | ||
{{MatParam|$color2|RGB matrix| | {{MatParam|$color2|RGB matrix|{{L|$color#Models|Color tinting}}.}} | ||
{{MatParam|$basetexturetransform|matrix| | {{MatParam|$basetexturetransform|matrix|{{L|$basetexture#.24basetexturetransform|Transform}} {{L|$basetexture}}'s alignment, scale, rotation and position.}} | ||
{{MatParam|$allowdiffusemodulation|bool|Prevents the model's material from being tinted by | {{MatParam|$allowdiffusemodulation|bool|Prevents the model's material from being tinted by {{L|$color2}} or <code>rendercolor.</code>|since={{l4d}}}} | ||
{{MatParam|$seperatedetailuvs|bool|{{todo|''Confirm use of texcoord1 for | {{MatParam|$seperatedetailuvs|bool|{{todo|''Confirm use of texcoord1 for {{L|$detail|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|$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 {{L|$color2}} or <code>rendercolor.</code>|only={{csgo}}|also={{P2CE}}}} | ||
=== Transparency === | === Transparency === | ||
'''VertexLitGeneric''' support a few different methods for transparency, each for different purposes | '''VertexLitGeneric''' support a few different methods for transparency, each for different purposes | ||
{{MatParam|$alpha|bool| | {{MatParam|$alpha|bool|{{L|$alpha}} {{L|Cheap|Cheaply}} scales the opacity of an entire material.{{confirm|Does this work in any engine branch? It does not in {{src13mp}}.}}}} | ||
{{MatParam|$alphatest|bool| | {{MatParam|$alphatest|bool|{{L|$alphatest}} is a {{L|Cheap}} transparency using a binary opacity mask.}} | ||
{{MatParam|$nocull|bool| | {{MatParam|$nocull|bool|{{L|$nocull}} disables backface culling optimization.}} | ||
{{MatParam|$translucent|bool| | {{MatParam|$translucent|bool|{{L|$translucent}} is a {{L|Expensive|expensive}} translucency using a full {{L|Alpha}} mask, for very fine gradients.<br/>{{note|Add material sorting issues}}}} | ||
{{MatParam|$additive|bool| | {{MatParam|$additive|bool|{{L|$additive}} alike {{L|$translucent}} perform full {{L|Alpha}} mask, however it add colors instead of performing a multiplication. This renders in a always brighter material.}} | ||
{{MatParam|$distancealpha|bool| | {{MatParam|$distancealpha|bool|{{L|$distancealpha}} is a vector-like edge filtering.|since={{src07}}}} | ||
=== Lighting === | === Lighting === | ||
{{MatParam|$bumpmap|texture| | {{MatParam|$bumpmap|texture| {{L|Bump_map|Normal map}}.}} | ||
{{MatParam|$lightwarptexture|texture|1 dimension Per-texel color modification via a | {{MatParam|$lightwarptexture|texture|1 dimension Per-texel color modification via a {{L|$lightwarptexture|warp texture}}.|since={{src06}}}} | ||
{{MatParam|$halflambert|bool|Use | {{MatParam|$halflambert|bool|Use {{L|$halflambert|Half-lambertian}} shading.}} | ||
{{MatParam|$selfillum|bool|Determines whether the surface is | {{MatParam|$selfillum|bool|Determines whether the surface is {{L|Glowing_Textures#.24selfillum|self-illuminated}} independent of environment lighting.}} | ||
{{MatParam|$emissiveblendenabled|bool| | {{MatParam|$emissiveblendenabled|bool|{{L|Glowing_Textures#.24emissiveblend|Advanced flowing self-illumination}}, used on the {{L|Vortigaunt|Vortigaunts}} in {{Game link|Half-Life 2: Episode Two}}.|since={{src07}}}} | ||
{{MatParam|$lightmap|texture|Pre-baked | {{MatParam|$lightmap|texture|Pre-baked {{L|lightmap}}; subject to {{L|$lightmap#Limitations_and_caveats|limitations}}.|only={{src13mp}}|also={{gmod}}}} | ||
=== Reflection === | === Reflection === | ||
{{MatParam|$envmap|texture| | {{MatParam|$envmap|texture|{{L|$envmap|Specular reflections}}.}} | ||
{{MatParam|$phong|bool| | {{MatParam|$phong|bool|{{L|$phong|Diffuse reflections}}.|since={{src06}}}} | ||
{{MatParam|$rimlight|bool|Constant | {{MatParam|$rimlight|bool|Constant {{L|$rimlight|rimlight}} based on {{L|phong}} and the ambient lighting.|since={{src07}}}} | ||
=== Effect === | === Effect === | ||
{{MatParam|$compress|texture| | {{MatParam|$compress|texture|{{L|Wrinkle_maps#Materials_and_textures|Wrinklemaps}} for character faces.|since={{src07}}}} | ||
{{MatParam|$stretch|texture| | {{MatParam|$stretch|texture|{{L|Wrinkle_maps#Materials_and_textures|Wrinklemaps}} for character faces.|since={{src07}}}} | ||
{{MatParam|$flesh|bool|The | {{MatParam|$flesh|bool|The {{L|$flesh|flesh}} effect used for Alyx in Half-Life 2: Episode Two.|since={{src07}}}} | ||
{{MatParam|$treeSway|bool|Vertex manipulation to give the effect of | {{MatParam|$treeSway|bool|Vertex manipulation to give the effect of {{L|$treeSway|trees swaying}} in the wind.|since={{l4d}}|also={{tf2}}{{mapbase}}{{gmod}}{{bms}}}} | ||
=== Technical Workarounds === | === Technical Workarounds === | ||
{{MatParam|$flashlightnolambert|bool|Tell | {{MatParam|$flashlightnolambert|bool|Tell {{L|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 66: | Line 56: | ||
===Cloak=== | ===Cloak=== | ||
<code>VertexLitGeneric</code> natively supports the Spy cloak effect from {{Game link|Team Fortress 2}}. Combine it with a sine wave | <code>VertexLitGeneric</code> natively supports the Spy cloak effect from {{Game link|Team Fortress 2}}. Combine it with a sine wave {{L|Material Proxies|proxy}} for the full effect. | ||
{{MatParam|$cloakpassenabled|bool|Enables cloaking effects. {{warning|Enabling this on static props causes a heavy performance penalty, even if the cloak effect itself isn't being used!}}}} | {{MatParam|$cloakpassenabled|bool|Enables cloaking effects. {{warning|Enabling this on static props causes a heavy performance penalty, even if the cloak effect itself isn't being used!}}}} | ||
Line 77: | Line 67: | ||
=== Mapbase === | === Mapbase === | ||
VertexLitGeneric materials in | VertexLitGeneric materials in {{L|Mapbase}} should have the shader '''<code>SDK_VertexLitGeneric</code>'''. | ||
== See also == | == See also == | ||
* | * {{L|Materials_for_models#Compiling_your.VMT_:_Valve_Material_Type|Materials for models}} | ||
*{{ent|EyeRefract}}, the shader for modeled eyes. | *{{ent|EyeRefract}}, the shader for modeled eyes. | ||
*{{ent|Teeth}}, the shader for modeled teeth. | *{{ent|Teeth}}, the shader for modeled teeth. |
Revision as of 03:22, 24 April 2025

As a courtesy, please do not edit this while this message is displayed.
If this page has not been edited for at least several hours to a few days, please remove this template. This message is intended to help reduce edit conflicts; please remove it between editing sessions to allow others to edit the page.
The person who added this notice will be listed in its edit history should you wish to contact them.

You can help by finishing the translation.
If this page cannot be translated for some reason, or is left untranslated for an extended period of time after this notice is posted, the page should be requested to be deleted.
Also, please make sure the article complies with the alternate languages guide.

It is not recommended to use machine translation without any corrections.
If the article is not corrected in the long term, it will be removed.
Also, please make sure the article complies with the alternate languages guide.
This notice is put here by LanguageBar template and if you want to remove it after updating the translation you can do so on this page.
VertexLitGeneric
是一个顶点着色器 ,可在所有的 起源 游戏中使用。 It is the shader most commonly used to render models , and supports a variety of effects. Do not use this on world geometry, else you may encounter lighting bugs.
Supported Parameters
Basics
$basetexture
$detail
$decaltexture
Adjustment
$color2
$basetexturetransform
$allowdiffusemodulation
$seperatedetailuvs
$desaturatewithbasealpha
$notint
Transparency
VertexLitGeneric support a few different methods for transparency, each for different purposes
$alpha
$alphatest
$nocull
$translucent
$additive
$distancealpha
Lighting
$bumpmap
$lightwarptexture
$halflambert
$selfillum
$emissiveblendenabled
$lightmap
Reflection
Effect
$compress
$stretch
$flesh
$treeSway
Technical Workarounds
$flashlightnolambert
$lowqualityflashlightshadows
$allowfencerenderstatehack
$disablecsmlookup
$noshadowpass
$nodeferredlight
$modelglobalnormal
Cloak
VertexLitGeneric
natively supports the Spy cloak effect from Team Fortress 2 . Combine it with a sine wave proxy for the full effect.
$cloakpassenabled
$cloakfactor
$cloakcolortint
$refractamount
Caveats
Mapbase
VertexLitGeneric 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.