Skip to Content
DocumentationFeaturesCel Shading

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.

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.

Standard Lambert diffuse — soft, continuous falloff.

Three discrete bands with a hard threshold edge.

Lit (PBR)
Cel · Stepped (3)

The same material with the diffuse term quantized into three bands. Drag to compare.

Properties

Inspector labelShader propertyTypeDefaultDescription
Cel Mode_CelModeenumSingleSingle, Stepped, or Ramp band model.
Threshold_CelThresholdFloat (0–1)0.5Position of the shadow edge along NdotL. Single mode only.
Steps_CelStepsInt (1–8)3Number of light bands. Stepped mode only.
Edge Smoothness_CelSmoothnessFloat (0–1)0.02Anti-aliased width of band edges. Lower is sharper.
Ramp Texture_CelRampTexture2DNone1D ramp sampled by NdotL. Ramp mode only.
Shadow Color_CelShadowColorColorRGB(0.18, 0.20, 0.28)Tint applied to the shadow band; multiplies albedo.
Shadow Intensity_CelShadowIntensityFloat (0–1)1.0Blend amount between lit albedo and the shadow tint.

Usage

  1. Set the material’s Rendering Mode to Toon (recommended) or keep Lit for hybrid PBR + toon.
  2. Enable Cel Shading in the inspector. Single mode is applied immediately.
  3. Switch Cel Mode to Stepped and adjust Steps until the silhouette reads correctly at gameplay distance — three is a strong starting point.
  4. For the polished look, switch to Ramp and assign a ramp texture authored in the Ramp Creator.
  5. 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.
Last updated on