Modes are different ways your shader will render under different passes or conditions.
A mode can be specified in three ways:
Mode()
Mode( S_MODE_COMBO )
- sets the combo when this mode is activeMode( "mode_fallback.shader" )
- uses a different shader for this modeYour typical modes section might look like:
MODES
{
VrForward();
Depth();
ToolVis( S_MODE_TOOLS_VIS );
}
Default |
Used for compute shaders |
---|---|
VrForward |
Standard rendering |
Depth |
Depth prepass, shadows |
Reflection |
SSR pass (removed in future) |
ToolsShadingComplexity |
Shows Quad Overdraw |
ToolsVis |
Used when mat_fullbright is set g_nToolsVisMode will be populated. |
ToolsUtil |
Stuff that only draws in tool views |