A hard-threshold cel shader that quantizes lighting into crisp bands: per-light distance + shadow attenuation gate the contribution, diffuse appears only when the Lambert term exceeds a tunable threshold, and a sharp specular “spark” triggers above its own threshold (scaled by surface smoothness). Diffuse is tinted by the material color, highlights by its specular color - for clean, controllable toon shading.
Outlines are generated using the normal and depth buffers - plus an optional vertex-color ID mask - to detect discontinuities. Edges appear where surface orientation, distance, or color IDs change, producing clean, controllable ink lines (with tunable thresholds and thickness) that remain stable across flat fills and complex geometry.