文档

Unity Engine


User Manual

Script Reference

Unity Engine


ShaderLab pass tags in the Built-In Render Pipeline reference

Find the LightMode tag values you can use to control which pass the Built-In Render Pipeline executes.
阅读时间1 分钟最后更新于 1 个月前

重要
The Built-In Render Pipeline is deprecated and will be made obsolete in a future release.
It remains supported, including bug fixes and maintenance, through the full Unity 6.7 LTS lifecycle.
Find the
LightMode
tag values you can use to control which pass the Built-In Render Pipeline executes.
If you do not set the
LightMode
tag in a Pass, the Built-In Render Pipeline uses the
Always
tag value for that Pass.

Value

Function

Always
Always rendered; does not apply any lighting. This is the default value.
ForwardBase
Used in Forward rendering; applies ambient, main directional light, vertex/SH lights and lightmaps.
ForwardAdd
Used in Forward rendering; applies additive per-pixel lights, one Pass per light.
Deferred
Used in Deferred Shading; renders G-buffer.
ShadowCaster
Renders object depth into the shadowmap or a depth texture.
MotionVectors
Used to calculate per-object motion vectors.
Vertex
Used in legacy Vertex Lit rendering when the object is not lightmapped; applies all vertex lights.
VertexLMRGBM
Used in legacy Vertex Lit rendering when the object is lightmapped, and on platforms where the lightmap is RGBM encoded (PC & console).
VertexLM
Used in legacy Vertex Lit rendering when the object is lightmapped, and on platforms where lightmap is double-LDR encoded (mobile platforms).
Meta
This Pass is not used during regular rendering, only for lightmap baking or Enlighten Realtime Global Illumination. For more information, refer to Lightmapping and shaders.

Additional resources