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.
When not to touch this
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
Usage
- Identify the visual symptom: flicker means Z-fighting, missing back faces means cull, popping means queue order.
- Apply the minimum override that fixes it; the defaults are correct for most materials.
- For decals, set Offset Factor to -1 and Offset Units to -1 to pull them off the surface.
- 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 biasTips & 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.
Related
- Surface Settings — blend mode drives the default queue.
- See-Through — uses stencil to mask blocked silhouettes.
- Outline — the inverted-hull pass respects the cull mode.
- Dither Transparency — sort-free alternative to queue tweaking.
Last updated on