Skip to main content

Module shader

Module shader 

Source
Expand description

A Shader’s render state as stored (m_ParsedForm): its subshaders, their passes and the passes’ render-state values, with the BlendMode values they use. crate::material::ShaderData decodes them from a Shader object; procedural says which shaders build their geometry from component data.

Modules§

blend_mode
Unity’s BlendMode values (UnityEngine.Rendering.BlendMode) a pass’s blend factors use.

Structs§

PassState
The rest of a pass’s render state as stored (m_State): every render target’s blend, the depth test and offset and the stencil.
ShaderPass
A shader pass’s kind and render state: its LightMode tag as stored (Unity upper-cases some: FORWARDBASE), the first render target’s blend factors (Unity’s BlendMode, blend_mode: 0 Zero, 1 One, 5 SrcAlpha, 10 OneMinusSrcAlpha, …), depth writes and culling (0 off, 1 front, 2 back).
ShaderStencilOp
A stencil face’s operations (SerializedStencilOp): Unity’s StencilOp for pass, fail and depth-fail, and its CompareFunction (0 disabled, 1 never, 2 less, 3 equal, 4 less or equal, 5 greater, 6 not equal, 7 greater or equal, 8 always).
ShaderTargetBlend
One render target’s blend and write mask as the pass states them (rtBlend0 to rtBlend7): Unity’s BlendMode factors and BlendOp operations, and the colour mask (bit 0 red to bit 3 alpha).
ShaderValue
A render-state value of a shader pass: the value the shader declares, and the material property it is bound to (Blend [_SrcBlend] ...), which then gives the value.
SubShader
A subshader: its tags as stored (Unity upper-cases some keys: QUEUE) and its passes in order.

Enums§

PassKind
What a pass is (m_Type): one with its own state and programs, a UsePass naming another shader’s pass (m_UseName, its state not here), or a GrabPass copying the screen to a texture (it draws nothing).

Functions§

procedural
Whether a shader builds its geometry from component data, drawing a placeholder mesh: Shapes (a widely used package’s line, disc, triangle and sphere shaders).