Zh/UnlitGeneric: Difference between revisions

From Valve Developer Community
< Zh
Jump to navigation Jump to search
(Created page with "{{subst:#if: Translation of 'UnlitGeneric' to '中文' via Template:LanguageBar buttons * * * * * * * * * * * * * * * * * * * * * * * * * * * *...")
 
No edit summary
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{subst:#if:|||{{LAuto/t}}
{{Machine Translation}}
 
--- 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}}
{{LanguageBar}}


'''{{code|UnlitGeneric}}''' draws a [[diffuse]] without standard lighting passes. It is used for things like UI images, pure white, and pitch blackness, but also in situations when software lighting is used (like on [[detail prop]]s).
'''{{code|UnlitGeneric}}''' 是一种不通过标准光照通道渲染{{L|diffuse|漫反射}}的着色器。通常用于UI图像、纯白或纯黑场景,也适用于使用软件光照的情况(如{{L|detail prop|细节道具}})。


== Supported Parameters ==
== 支持参数 ==


=== Basics ===
=== 基础参数 ===
{{MatParam|$basetexture|texture|Defines a diffuse texture.}}
{{MatParamDef|$basetexture|texture|定义漫反射纹理。}}
{{MatParam|$surfaceprop|string|Links the [[$surfaceprop|surface]] to a set of physical properties.}}
{{MatParamDef|$surfaceprop|string|将{{L|$surfaceprop|表面属性}}与物理属性集关联。}}
{{MatParam|$model|bool|Tells this material is used for [[3D Model|models]] and not [[Brush|brushes]].}}
{{MatParamDef|$model|bool|声明该材质用于{{L|3D Model|模型}}而非{{L|Brush|笔刷}}。}}


=== Adjustment ===
=== 调整参数 ===
{{MatParam|$detail|Texture|Multitexturing.}}
{{MatParamDef|$detail|Texture|多重纹理混合。}}
{{MatParam|$color|RGB matrix|Independently scales the red, green and blue channels of an albedo.}}
{{MatParamDef|$color|RGB matrix|独立缩放反照率的红、绿、蓝通道。}}


=== Transparency ===
=== 透明参数 ===
{{MatParam|$alpha|normal|Scales the opacity of an entire material.}}
{{MatParamDef|$alpha|normal|控制材质整体透明度。}}
{{MatParam|$alphatest|bool|Specifies a mask to use to determine binary opacity.}}
{{MatParamDef|$alphatest|bool|使用遮罩实现二值化透明度检测。}}
{{MatParam|$nocull|bool|Disables backface culling, resulting in triangles showing from both sides.}}
{{MatParamDef|$nocull|bool|禁用背面剔除,允许双面显示三角形。}}
{{MatParam|$translucent|bool|Specifies that the material should be partially see-through.}}
{{MatParamDef|$translucent|bool|启用材质半透明效果。}}
{{MatParam|$vertexalpha|bool|Per-vertex translucency on [[displacement]]s}}
{{MatParamDef|$vertexalpha|bool|在{{L|displacement|位移表面}}上启用逐顶点透明度}}


=== Texture Organization ===
=== 纹理组织 ===
{{MatParam|%keywords|string|Sets a keyword filter that can be filtered in hammer for easier texture finding.}}
{{MatParamDef|%keywords|string|设置材质关键词,便于在Hammer中筛选查找。}}
{{MatParam|%notooltexture|bool|Hides the material from Hammer's texture browser.}}
{{MatParamDef|%notooltexture|bool|在Hammer纹理浏览器中隐藏该材质。}}
{{MatParam|%tooltexture|texture|Used to blend texture previews in [[Hammer]].}}
{{MatParamDef|%tooltexture|texture|用于在{{L|Hammer}}中混合纹理预览。}}


=== Effect ===
=== 效果参数 ===
{{MatParam|$nofog|bool|Prevents fog from overdrawing a material.}}
{{MatParamDef|$nofog|bool|阻止雾气效果覆盖该材质。}}


== Additional Parameters ==
== 扩展参数 ==


{{MatParam|$receiveflashlight|bool|Allow the player's flashlight to illuminate the material.}}
{{MatParamDef|$receiveflashlight|bool|允许玩家手电筒照亮该材质。}}
{{MatParam|$singlepassflashlight|bool|Possibly used to allow shadows to form from this decal.<br/>For example, found in L4D2 ''decals/detail/ruraldetailsprites.vmt''<br/>{{todo|confirm.}}}}
{{MatParamDef|$singlepassflashlight|bool|可能用于允许该贴花投射阴影。<br/>例如在L4D2的 ''decals/detail/ruraldetailsprites.vmt'' 中使用<br/>{{todo|需确认}}}}
{{MatParam|$deferred|bool|only={{lw}}|{{confirm|Enables/disables deferred lighting on this material?}}}}
{{MatParamDef|$deferred|bool|only={{lw}}|{{confirm|是否启用该材质的延迟光照?}}}}


== Caveats ==
== 注意事项 ==


=== Projected Texture Bugs ===
=== 投影纹理错误 ===
If a [[Skybox]] has an '''{{code|UnlitGeneric}}''' shader applied to it, some visual bugs can occur. Notably, if a projected texture is shone near a Skybox using an '''{{code|UnlitGeneric}}''' shader, the Skybox may appear to ignore surrounding geometry and phase through walls for as long as the projected texture is active.
若在{{L|Skybox|天空盒}}上使用'''{{code|UnlitGeneric}}'''着色器,可能出现视觉错误。特别是当投影纹理照射到使用该着色器的天空盒附近时,天空盒可能无视周围几何体并穿透墙体显示。


To fix this, ensure that a [[sky_camera]] exists in the world, typically in its own box which exists outside of the rest of the map.
解决方案:确保场景中存在{{L|sky_camera}}实体,通常放置在地图外部的独立天空盒中。


Preferably, use the purpose-built '''{{code|[[Sky_(shader)|Sky]]}}''' shader instead.
建议改用专用着色器'''{{code|{{L|Sky_(shader)|Sky}}}}'''


=== Models ===
=== 模型应用 ===
If this shader is being used on a [[model]], you must specify {{code|[[$model_(VMT)|$model 1]]}} to prevent errors.
在{{L|model|模型}}上使用此着色器时,必须指定{{code|{{L|$model_(VMT)|$model 1}}}}以避免错误。


=== Mapbase ===
=== Mapbase扩展 ===
Unlit materials in [[Mapbase]] should have the shader '''{{code|SDK_UnlitGeneric}}'''.
{{L|Mapbase}}中的无光照材质应使用'''{{code|SDK_UnlitGeneric}}'''着色器。
[[Category:Shaders]]
{{ACategory|Shaders}}
[[Category:Stubs]]
{{ACategory|Stubs}}

Latest revision as of 12:10, 23 August 2025

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)
English (en)Français (fr)中文 (zh)Translate (Translate)

UnlitGeneric 是一种不通过标准光照通道渲染漫反射(en)的着色器。通常用于UI图像、纯白或纯黑场景,也适用于使用软件光照的情况(如细节道具(en))。

支持参数

基础参数

定义漫反射纹理。
表面属性(en)与物理属性集关联。
声明该材质用于模型(en)而非笔刷(en)

调整参数

多重纹理混合。
独立缩放反照率的红、绿、蓝通道。

透明参数

控制材质整体透明度。
使用遮罩实现二值化透明度检测。
禁用背面剔除,允许双面显示三角形。
启用材质半透明效果。
位移表面(en)上启用逐顶点透明度

纹理组织

设置材质关键词,便于在Hammer中筛选查找。
在Hammer纹理浏览器中隐藏该材质。
用于在Hammer(en)中混合纹理预览。

效果参数

阻止雾气效果覆盖该材质。

扩展参数

允许玩家手电筒照亮该材质。
可能用于允许该贴花投射阴影。
例如在L4D2的 decals/detail/ruraldetailsprites.vmt 中使用
待完善: 需确认
$deferred(en) <布尔值(en)> (存在于 Lambda Wars 之中)
证实:是否启用该材质的延迟光照?

注意事项

投影纹理错误

若在天空盒(en)上使用UnlitGeneric着色器,可能出现视觉错误。特别是当投影纹理照射到使用该着色器的天空盒附近时,天空盒可能无视周围几何体并穿透墙体显示。

解决方案:确保场景中存在sky_camera(en)实体,通常放置在地图外部的独立天空盒中。

建议改用专用着色器Sky(en)

模型应用

模型(en)上使用此着色器时,必须指定$model 1(en)以避免错误。

Mapbase扩展

Mapbase(en)中的无光照材质应使用SDK_UnlitGeneric着色器。