Skip to Content
DocumentationFeaturesRendering Options

Rendering Options

The Rendering Options block exposes the low-level render-state knobs you would otherwise need a custom shader to tweak: cull mode, ZWrite, depth bias, render queue, and stencil. It is where you fix sorting issues, force two-sided foliage, or carve a stencil mask for the See-Through feature.

When to use it

  • Two-sided foliage and cloth — set the cull mode to Off.
  • Z-fighting decals — apply a small negative depth bias.
  • Sort ordering — nudge the render queue by plus or minus 50 to break ties.
  • See-Through stencil masking — write a stencil ref the masked material reads.

How it works

Rendering Options exposes each setting as a material override and feeds it into the SubShader pass tags through material property drawers. Most values map 1:1 to Unity’s render-state API, so anything you would write in an HLSL block is reachable from the inspector.

Properties

Inspector labelShader propertyTypeDefaultDescription
Cull Mode_CullModeEnumBackOff, Front, or Back. Off renders two-sided.
ZWrite_ZWriteEnumOnForce-override Z write; auto by blend mode otherwise.
ZTest_ZTestEnumLEqualDepth test op. Set Always for see-through silhouettes.
Queue Offset_QueueOffsetInt (-200–200)0Added to the auto queue (2000 Opaque / 3000 Transparent).
Offset Factor_OffsetFactorFloat0Depth bias factor for decals.
Offset Units_OffsetUnitsFloat0Depth bias constant for decals.
Stencil Ref_StencilRefInt (0–255)0Stencil reference value.
Stencil Comp_StencilCompEnumAlwaysStencil compare op.
Stencil Op_StencilOpEnumKeepStencil pass op.

Usage

  1. Identify the visual symptom: flicker means Z-fighting, missing back faces means cull, popping means queue order.
  2. Apply the minimum override that fixes it; the defaults are correct for most materials.
  3. For decals, set Offset Factor to -1 and Offset Units to -1 to pull them off the surface.
  4. For stencil masking, set Stencil Ref to 1 and Stencil Op to Replace on the writer, and Stencil Comp to Equal on the reader.
material.SetInt("_CullMode", 0); // Off → two-sided material.SetInt("_QueueOffset", 50); // Push behind other transparents material.SetFloat("_OffsetUnits", -1f); // Decal Z bias

Tips & gotchas

  • ZWrite Off with the Opaque queue is a classic mistake — the surface will not sort correctly. Flip the queue or turn ZWrite back on.
  • Negative queue offsets can pull a transparent in front of the skybox; cap them at plus or minus 200.
  • Depth bias is hardware-dependent — a value that works on PC may be too weak on Adreno mobile GPUs.
  • Stencil ref 0 is reserved in many post-FX stacks (outline, fog). Start your custom values at 1.
Last updated on