Cel Shading
Cel shading converts continuous diffuse lighting into a small number of discrete bands, producing the crisp, ink-and-paint look found in anime, cartoons, and many stylized games. Genesis exposes three modes — Single, Stepped, and Ramp — and is designed to layer with the rim, specular, and outline features for a complete toon stack.
When to use it
- Stylized characters that need a clean cartoon read.
- Mobile / VR projects that benefit from flat color regions, which compress well and shade cheaply.
- Hybrid PBR, where you keep specular and reflections physically based while quantizing only the diffuse term.
Difference from Unlit
Modes
Genesis selects the mode with the Cel Mode dropdown (_CelMode):
- Single — one hard threshold splits lit and shadow. Strongest comic-book read and the cheapest option.
- Stepped — a configurable number of evenly spaced bands. Three is the most common; five to seven gives a softer, painted look.
- Ramp — samples a 1D ramp texture by
NdotL, handing art full control over colored shadows and warm-to-cool transitions. Author ramps with the Ramp Creator.
The same material with the diffuse term quantized into three bands. Drag to compare.
Properties
Usage
- Set the material’s Rendering Mode to Toon (recommended) or keep Lit for hybrid PBR + toon.
- Enable Cel Shading in the inspector. Single mode is applied immediately.
- Switch Cel Mode to Stepped and adjust Steps until the silhouette reads correctly at gameplay distance — three is a strong starting point.
- For the polished look, switch to Ramp and assign a ramp texture authored in the Ramp Creator.
- Layer Rim Lighting and Outline for the full toon stack.
// Drive cel shading at runtime via a Genesis material
material.SetFloat("_CelMode", 1); // 0 = Single, 1 = Stepped, 2 = Ramp
material.SetInt ("_CelSteps", 4);
material.SetColor("_CelShadowColor", new Color(0.20f, 0.22f, 0.30f));Tips & gotchas
- Use Edge Smoothness (
_CelSmoothness) instead of texture filtering to anti-alias band edges — it preserves sharpness up close and softens only the edge. - Receive Shadows must be enabled on the renderer for cast shadows to feed
NdotL; otherwise self-shadowing is the only contribution. - The Ramp Creator writes 256×4 ramp textures with linear sampling and no mipmaps. Match those settings if you author ramps externally to avoid banding.
- Stepped mode at one step is not equivalent to Single mode — use Single for the lowest cost.
Related
- Specular Highlights — stylized highlights that pair with cel.
- Rim Lighting — fresnel edge to complete the toon look.
- Outline — inverted-hull and screen-space outlines.
- Ramp Creator — author and edit ramp textures inside Unity.
Last updated on