Zh/VertexLitGeneric: Difference between revisions
< Zh
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{LanguageBar}} | |||
{{LanguageBar}} | |||
= | {{this is a|vertex shader|name=VertexLitGeneric}} 这是渲染{{L|models|模型}}最常用的着色器,支持多种特效效果。请勿用于世界几何体,否则可能引发光照错误。 | ||
=== | == 支持参数 == | ||
=== | === 基础参数 === | ||
{{ | {{MatParamDef|$basetexture|texture|{{L|$basetexture}}定义{{L|diffuse|漫反射}}纹理。}} | ||
{{MatParamDef|$detail|texture|{{L|$detail|细节}}纹理混合。}} | |||
{{MatParamDef|$decaltexture|texture|使用第二UV通道支持高分辨率贴花。|only={{csgo}}}} | |||
{{ | |||
{{ | |||
=== | === 调整参数 === | ||
{{MatParamDef|$color2|RGB matrix|{{L|$color#Models|颜色染色}}效果。}} | |||
{{ | {{MatParamDef|$basetexturetransform|matrix|{{L|$basetexture#.24basetexturetransform|变换}}{{L|$basetexture}}的对齐、缩放、旋转和位置。}} | ||
{{ | {{MatParamDef|$allowdiffusemodulation|bool|阻止模型材质被{{L|$color2}}或<code>rendercolor</code>染色。|since={{l4d}}}} | ||
{{ | {{MatParamDef|$seperatedetailuvs|bool|{{todo|''确认是否使用texcoord1处理{{L|$detail|细节}}纹理''}}|since={{src07}}}} | ||
{{ | {{MatParamDef|$desaturatewithbasealpha|float|使用基础alpha通道对基础纹理去色。非零值启用,该值在去色前与alpha通道相乘。|since={{as}}}} | ||
{{ | {{MatParamDef|$notint|bool|阻止模型材质被{{L|$color2}}或<code>rendercolor</code>染色。|only={{csgo}}|also={{P2CE}}}} | ||
{{ | |||
=== | === 透明参数 === | ||
{{ | '''VertexLitGeneric'''支持多种透明处理方式: | ||
{{MatParamDef|$alpha|bool|{{L|$alpha}}通过{{L|Cheap|低开销}}方式整体调节材质透明度。{{confirm|该参数在所有引擎分支是否有效?在{{src13mp}}中无效}}}} | |||
{{ | {{MatParamDef|$alphatest|bool|{{L|$alphatest}}使用{{L|Cheap}}二值化透明遮罩。}} | ||
{{ | {{MatParamDef|$nocull|bool|{{L|$nocull}}禁用背面剔除优化。}} | ||
{{ | {{MatParamDef|$translucent|bool|{{L|$translucent}}通过完整{{L|Alpha|透明通道}}实现{{L|Expensive|高开销}}半透明,适用于精细渐变。<br/>{{note|可能引发材质排序问题}}}} | ||
{{ | {{MatParamDef|$additive|bool|{{L|$additive}}类似{{L|$translucent}}但采用加法混合,始终呈现更亮效果。}} | ||
{{MatParamDef|$distancealpha|bool|{{L|$distancealpha}}实现矢量式边缘过滤。|since={{src07}}}} | |||
=== | === 光照参数 === | ||
{{ | {{MatParamDef|$bumpmap|texture| {{L|Bump_map|法线贴图}}。}} | ||
{{ | {{MatParamDef|$lightwarptexture|texture|通过一维{{L|$lightwarptexture|扭曲纹理}}实现逐像素颜色调整。|since={{src06}}}} | ||
{{ | {{MatParamDef|$halflambert|bool|启用{{L|$halflambert|半兰伯特}}着色。}} | ||
{{MatParamDef|$selfillum|bool|启用{{L|Glowing_Textures#.24selfillum|自发光}}效果(不受环境光照影响)。}} | |||
{{MatParamDef|$emissiveblendenabled|bool|{{L|Glowing_Textures#.24emissiveblend|高级流动自发光}}效果,曾用于{{Game link|Half-Life 2: Episode Two}}中的{{L|Vortigaunt|弗提冈}}。|since={{src07}}}} | |||
{{MatParamDef|$lightmap|texture|预烘焙{{L|lightmap|光照贴图}};受{{L|$lightmap#Limitations_and_caveats|限制条件}}约束。|only={{src13mp}}|also={{gmod}}}} | |||
=== | === 反射参数 === | ||
{{ | {{MatParamDef|$envmap|texture|{{L|$envmap|镜面反射}}效果。}} | ||
{{ | {{MatParamDef|$phong|bool|{{L|$phong|漫反射}}效果。|since={{src06}}}} | ||
{{ | {{MatParamDef|$rimlight|bool|基于{{L|phong}}和环境光的恒定{{L|$rimlight|边缘光}}。|since={{src07}}}} | ||
=== | === 特效参数 === | ||
{{ | {{MatParamDef|$compress|texture|角色面部的{{L|Wrinkle_maps#Materials_and_textures|皱纹贴图}}。|since={{src07}}}} | ||
{{ | {{MatParamDef|$stretch|texture|角色面部的{{L|Wrinkle_maps#Materials_and_textures|皱纹贴图}}。|since={{src07}}}} | ||
{{ | {{MatParamDef|$flesh|bool|用于《半衰期2:第二章》艾丽克斯的{{L|$flesh|皮肤}}特效。|since={{src07}}}} | ||
{{ | {{MatParamDef|$treeSway|bool|通过顶点操作实现{{L|$treeSway|树木随风摆动}}效果。|since={{l4d}}|also={{tf2}}{{mapbase}}{{gmod}}{{bms}}}} | ||
{{ | |||
=== | === 技术调整 === | ||
{{MatParamDef|$flashlightnolambert|bool|使{{L|env_projectedtexture|投影纹理}}(如手电筒)忽略模型表面法线。适用于{{ent|$nocull}}模型(如植被)。默认0。|since={{src07}}}} | |||
{{MatParamDef|$lowqualityflashlightshadows|bool|强制低质量手电筒/投影纹理阴影以提升性能。|since={{portal2}}}} | |||
{{MatParamDef|$allowfencerenderstatehack|bool|针对级联阴影映射的栅栏渲染修正。|since={{csgo}}}} | |||
{{MatParamDef|$disablecsmlookup|bool|禁用级联阴影映射查询/过滤,适用于密集植被。|since={{csgo}}}} | |||
{{MatParamDef|$noshadowpass|bool|禁用该材质的阴影渲染阶段。|only={{lw}}}} | |||
{{MatParamDef|$nodeferredlight|bool|禁用延迟光照输入。|only={{lw}}}} | |||
{{MatParamDef|$modelglobalnormal|bool|为所有模型顶点使用全局光源方向作为法线。|only={{lw}}}} | |||
=== 隐身效果 === | |||
<code>VertexLitGeneric</code>原生支持{{Game link|Team Fortress 2}}中间谍隐身特效。结合正弦波{{L|Material Proxies|材质代理}}可实现完整效果。 | |||
{{ | |||
== | {{MatParamDef|$cloakpassenabled|bool|启用隐身效果。{{warning|在静态道具上启用会导致严重性能损耗,即使未实际使用隐身效果!}}}} | ||
{{MatParamDef|$cloakfactor|normal|0.00 {{=}} 完全可见,<br/> | |||
1.00 {{=}} 完全不可见。}} | |||
{{MatParamDef|$cloakcolortint|RGB matrix|折射效果染色。默认值"[1 1 1]"。}} | |||
{{MatParamDef|$refractamount|float|部分隐身时的折射强度。默认值2。}} | |||
=== | == 注意事项 == | ||
== | === Mapbase扩展 === | ||
* {{L|Materials_for_models#Compiling_your.VMT_:_Valve_Material_Type| | {{L|Mapbase}}中的VertexLitGeneric材质应使用'''<code>SDK_VertexLitGeneric</code>'''着色器。 | ||
*{{ent|EyeRefract}} | |||
*{{ent|Teeth}} | == 相关链接 == | ||
* {{L|Materials_for_models#Compiling_your.VMT_:_Valve_Material_Type|模型材质指南}} | |||
*{{ent|EyeRefract}}(眼球折射着色器) | |||
*{{ent|Teeth}}(牙齿着色器) |
Latest revision as of 12:10, 23 August 2025

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.
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.
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
是一个顶点着色器 ,可在所有的 起源 游戏中使用。 这是渲染模型 最常用的着色器,支持多种特效效果。请勿用于世界几何体,否则可能引发光照错误。
支持参数
基础参数
$basetexture 定义漫反射 纹理。
使用第二UV通道支持高分辨率贴花。
调整参数
颜色染色 效果。
变换$basetexture 的对齐、缩放、旋转和位置。
阻止模型材质被$color2 或
rendercolor
染色。待完善: 确认是否使用texcoord1处理细节 纹理
使用基础alpha通道对基础纹理去色。非零值启用,该值在去色前与alpha通道相乘。
透明参数
VertexLitGeneric支持多种透明处理方式:
$alphatest <布尔值 >
$alphatest 使用Cheap 二值化透明遮罩。
$translucent <布尔值 >
$additive 类似$translucent 但采用加法混合,始终呈现更亮效果。
$distancealpha 实现矢量式边缘过滤。
光照参数
通过一维扭曲纹理 实现逐像素颜色调整。
$halflambert <布尔值 >
启用半兰伯特 着色。
$selfillum <布尔值 >
启用自发光 效果(不受环境光照影响)。
反射参数
特效参数
技术调整
强制低质量手电筒/投影纹理阴影以提升性能。
针对级联阴影映射的栅栏渲染修正。
禁用级联阴影映射查询/过滤,适用于密集植被。
禁用该材质的阴影渲染阶段。
禁用延迟光照输入。
为所有模型顶点使用全局光源方向作为法线。
隐身效果
VertexLitGeneric
原生支持 Team Fortress 2 中间谍隐身特效。结合正弦波材质代理 可实现完整效果。
启用隐身效果。
警告:在静态道具上启用会导致严重性能损耗,即使未实际使用隐身效果!

0.00 = 完全可见,
1.00 = 完全不可见。
1.00 = 完全不可见。
折射效果染色。默认值"[1 1 1]"。
部分隐身时的折射强度。默认值2。
注意事项
Mapbase扩展
Mapbase 中的VertexLitGeneric材质应使用SDK_VertexLitGeneric
着色器。
相关链接
- 模型材质指南
- EyeRefract(眼球折射着色器)
- Teeth(牙齿着色器)