The Pass block causes the geometry of an object to be rendered once.
Pass {[Name and Tags\] [RenderSetup\] [TextureSetup] }
The basic pass command contains an optional list of render setup commands, optionally followed by a list of textures to use.
A Pass can define its Name and arbitrary number of Tags - name/value strings that communicate Pass’ intent to the rendering engine.
A pass sets up various states of the graphics hardware, for example should alpha blending be turned on, should fog be used, and so on. The commands are these:
Material {Material Block}
Defines a material to use in a vertex lighting pipeline. See Material page for details.
Lighting On | Off
Turn vertex lighting on or off. See Material page for details.
Cull Back | Front | Off
Set polygon culling mode. See Cull and Depth page for details.
ZTest (Less | Greater | LEqual | GEqual | Equal | NotEqual | Always)
Set depth testing mode. See Cull and Depth page for details.
ZWrite On | Off
Set depth writing mode. See Cull and Depth page for details.
Fog {Fog Block}
Set fog parameters. See Fog page for details.
AlphaTest (Less | Greater | LEqual | GEqual | Equal | NotEqual | Always) CutoffValue
Turns on alpha testing. See Alpha Testing page for details.
Blend SourceBlendMode DestBlendMode
Sets alpha blending mode. See Blending page for details.
Color Color-value
Sets color to use if vertex lighting is turned off. See Material page for details.
ColorMask RGB | A | 0 | any combination of R, G, B, A
Set color writing mask. Writing ColorMask 0 turns off rendering to all color channels. See Material page for details.
Offset OffsetFactor, OffsetUnits
Set Z buffer depth offset. See Cull and Depth page for details.
SeparateSpecular On | Off
Turns separate specular color for vertex lighting on or off. See Material page for details.
ColorMaterial AmbientAndDiffuse | Emission
Uses per-vertex color when computing vertex lighting. See Material page for details.
After the render state setup, you can specify a number of textures and their combining modes to apply using SetTexture commands: SetTexture texture property { [Combine options] }
The texture setup configures fixed function multitexturing pipeline, and is ignored if custom fragment shaders are used.
The per-pixel lighting pipeline works by rendering objects in multiple passes. Unity renders the object once to get ambient and any vertex lights in. Then it renders each pixel light affecting the object in a separate additive pass. See Render Pipeline for details.
Per-vertex lighting is the standard Direct3D/OpenGL lighting model that is computed for each vertex. Lighting on turns it on. Lighting is affected by Material block, ColorMaterial and SeparateSpecular commands. See Material page for details.
There are several special passes available for reusing common functionality or implementing various high-end effects: