Rendering

Modes

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 active
  • Mode( "mode_fallback.shader" ) - uses a different shader for this mode

Your typical modes section might look like:

MODES
{
    Forward();
    Depth();
}

Supported Modes

ModeDescription
DefaultUsed for compute shaders
ForwardStandard rendering
DepthDepth prepass, shadows
ToolsShadingComplexityShows Quad Overdraw

Source: Facepunch/sbox-docs (CC-BY-4.0) · updated 2025-08-11. Read it rendered on the official docs.

More in Rendering

Community wiki — not affiliated with Facepunch Studios. For the latest and most authoritative information, see the official developer wiki.