这篇条目有关 Source引擎。如需详情,点击这里。

Zh/VertexLitGeneric: Difference between revisions

From Valve Developer Community
< Zh
Jump to navigation Jump to search
(Created page with "{{subst:#if: Translation of 'VertexLitGeneric' to '中文' via Template:LanguageBar buttons * * * * * * * * * * * * * * * * * * * * * * * * * * * *...")
 
No edit summary
Line 1: Line 1:
{{subst:#if:|||{{LAuto/t}}
{{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.
--- DON'T JUST BLINDLY DELETE THIS PART. DO REPLACE THE LINKS AND CATEGORIES. THE PICTURE SHOWS HOW TO USE IT ! ---
 
SEARCH FOR:
\[\[(?!#|File(?:[ _]talk)?:|Image(?:[ _]talk)?:|Media:|Template(?:[ _]talk)?:|MediaWiki(?:[ _]talk)?:|Talk:|Category[ _]talk:|Project[ _]talk:|Valve[ _]Developer[ _]Community[ _]talk:|Help[ _]talk:|User(?:[ _]talk)?:|c:|commons:|Dictionary:|Google:|GoogleGroups:|IMDB:|M:|Meta:|Metawikipedia:|MW:|SdkBug:|SourceForge:|Steampowered:|W:|Wiki:|WikiBooks:|Wikipedia:|Wikiquote:|Wiktionary:|WP:)(:?(?:Category|Category|Help|Project|Valve[ _]Developer[ _]Community|Special|)(?:[^\|\]]+))(\|?.*?)\]\]
 
REPLACE WITH:
{{subst:LAuto|$1$2}}
 
}}{{wip}}{{translating}}
{{LanguageBar}}{{this is a|vertex shader|name=VertexLitGeneric}} It is the shader most commonly used to render [[models|models]], and supports a variety of effects. Do not use this on world geometry, else you may encounter lighting bugs.


== Supported Parameters ==
== Supported Parameters ==


=== Basics ===
=== Basics ===
{{MatParam|$basetexture|texture|[[$basetexture]] defines [[diffuse]] texture.}}
{{MatParam|$basetexture|texture|{{L|$basetexture}} defines {{L|diffuse}} texture.}}
{{MatParam|$detail|texture|[[$detail|Detail]] texturing.}}
{{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|[[$color#Models|Color tinting]].}}
{{MatParam|$color2|RGB matrix|{{L|$color#Models|Color tinting}}.}}
{{MatParam|$basetexturetransform|matrix|[[$basetexture#.24basetexturetransform|Transform]] [[$basetexture]]'s alignment, scale, rotation and position.}}
{{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 [[$color2]] or <code>rendercolor.</code>|since={{l4d}}}}
{{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 [[$detail|detail]] texture''}}|since={{src07}}}}
{{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 [[$color2]] or <code>rendercolor.</code>|only={{csgo}}|also={{P2CE}}}}
{{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|[[$alpha]] [[Cheap|Cheaply]] scales the opacity of an entire material.{{confirm|Does this work in any engine branch? It does not in {{src13mp}}.}}}}
{{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|[[$alphatest]] is a [[Cheap]] transparency using a binary opacity mask.}}
{{MatParam|$alphatest|bool|{{L|$alphatest}} is a {{L|Cheap}} transparency using a binary opacity mask.}}
{{MatParam|$nocull|bool|[[$nocull]] disables backface culling optimization.}}
{{MatParam|$nocull|bool|{{L|$nocull}} disables backface culling optimization.}}
{{MatParam|$translucent|bool|[[$translucent]] is a [[Expensive|expensive]] translucency using a full [[Alpha]] mask, for very fine gradients.<br/>{{note|Add material sorting issues}}}}
{{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|[[$additive]] alike [[$translucent]] perform full [[Alpha]] mask, however it add colors instead of performing a multiplication. This renders in a always brighter material.}}
{{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|[[$distancealpha]] is a vector-like edge filtering.|since={{src07}}}}
{{MatParam|$distancealpha|bool|{{L|$distancealpha}} is a vector-like edge filtering.|since={{src07}}}}


=== Lighting ===
=== Lighting ===
{{MatParam|$bumpmap|texture| [[Bump_map|Normal map]].}}
{{MatParam|$bumpmap|texture| {{L|Bump_map|Normal map}}.}}
{{MatParam|$lightwarptexture|texture|1 dimension Per-texel color modification via a [[$lightwarptexture|warp texture]].|since={{src06}}}}
{{MatParam|$lightwarptexture|texture|1 dimension Per-texel color modification via a {{L|$lightwarptexture|warp texture}}.|since={{src06}}}}
{{MatParam|$halflambert|bool|Use [[$halflambert|Half-lambertian]] shading.}}
{{MatParam|$halflambert|bool|Use {{L|$halflambert|Half-lambertian}} shading.}}
{{MatParam|$selfillum|bool|Determines whether the surface is [[Glowing_Textures#.24selfillum|self-illuminated]] independent of environment lighting.}}
{{MatParam|$selfillum|bool|Determines whether the surface is {{L|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}}}}
{{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 [[lightmap]]; subject to [[$lightmap#Limitations_and_caveats|limitations]].|only={{src13mp}}|also={{gmod}}}}
{{MatParam|$lightmap|texture|Pre-baked {{L|lightmap}}; subject to {{L|$lightmap#Limitations_and_caveats|limitations}}.|only={{src13mp}}|also={{gmod}}}}


=== Reflection ===
=== Reflection ===
{{MatParam|$envmap|texture|[[$envmap|Specular reflections]].}}
{{MatParam|$envmap|texture|{{L|$envmap|Specular reflections}}.}}
{{MatParam|$phong|bool|[[$phong|Diffuse reflections]].|since={{src06}}}}
{{MatParam|$phong|bool|{{L|$phong|Diffuse reflections}}.|since={{src06}}}}
{{MatParam|$rimlight|bool|Constant [[$rimlight|rimlight]] based on [[phong]] and the ambient lighting.|since={{src07}}}}
{{MatParam|$rimlight|bool|Constant {{L|$rimlight|rimlight}} based on {{L|phong}} and the ambient lighting.|since={{src07}}}}


=== Effect ===
=== Effect ===
{{MatParam|$compress|texture|[[Wrinkle_maps#Materials_and_textures|Wrinklemaps]] for character faces.|since={{src07}}}}
{{MatParam|$compress|texture|{{L|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|$stretch|texture|{{L|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|$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 [[$treeSway|trees swaying]] in the wind.|since={{l4d}}|also={{tf2}}{{mapbase}}{{gmod}}{{bms}}}}
{{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 [[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 {{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 [[Material Proxies|proxy]] for the full effect.
<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 [[Mapbase]] should have the shader '''<code>SDK_VertexLitGeneric</code>'''.
VertexLitGeneric materials in {{L|Mapbase}} should have the shader '''<code>SDK_VertexLitGeneric</code>'''.


== See also ==
== See also ==
* [[Materials_for_models#Compiling_your.VMT_:_Valve_Material_Type|Materials for models]]
* {{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

Under construction.png
This page is actively undergoing a major edit.
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.

Info content.png
This page is being translated.
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.(en)
English (en)Français (fr)中文 (zh)Translate (Translate)
Info content.png
This page is Machine translated
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.(en)
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是一个顶点着色器(en),可在所有的 起源 起源 游戏中使用。 It is the shader most commonly used to render models(en), 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

$envmap $phong $rimlight

Effect

$compress $stretch $flesh $treeSway

Technical Workarounds

$flashlightnolambert $lowqualityflashlightshadows $allowfencerenderstatehack $disablecsmlookup $noshadowpass $nodeferredlight $modelglobalnormal

Cloak

VertexLitGeneric natively supports the Spy cloak effect from 军团要塞2 Team Fortress 2 . Combine it with a sine wave proxy(en) for the full effect.

$cloakpassenabled $cloakfactor $cloakcolortint $refractamount

Caveats

Mapbase

VertexLitGeneric materials in Mapbase(en) should have the shader SDK_VertexLitGeneric.

See also