Cel light points toward the light in world space.
Normalized interpolated normals select shadow for N.L < threshold[0], base below threshold[1], highlight otherwise. Each band's linear RGB is factor*band tint, clamped. Optional rim adds rim_tint when 1-|N.V| >= rim_threshold (0 disables rim). Outline width is 0..4 device pixels; supersample is 1, 2 or 4 per axis. start_orb is 0 for ordinary cel shading, 1 for radial rest or 2 for hovered. Radial shading replaces material RGBA with opaque bands and two hard white spots at linear intensity 0.78 (rest) or 1 (hover); no clouds are drawn. Thresholds are ordered within [-1,1], band/rim RGB is finite nonnegative, rim_threshold is in [0,1], and light is finite nonzero. Silhouette outlines expand N pixels outwards; internal depth/material/normal lines are N pixels total. The renderer uses binary32 operations, no fast-math; GPU comparisons allow 1 channel LSB away from edges/band boundaries. Linear->sRGB uses round(255*(12.92*x if x<=0.0031308 else 1.055*x^(1/2.4)-0.055)), halves up. Atlas RGB modulates linear material RGB after sRGB decoding; alpha is linear. Opaque primitives write depth, then blend primitives draw back-to-front by mean transformed indexed-vertex depth (triangle corners counted with multiplicity), stable node/primitive order on equal depths. Alpha-textured blend materials are decals: their borders do not seed internal outline edges, preserving thin atlas glyphs at small device sizes. Named BadgeDigitOnes/Tens textured blend quads use unlit white ink with a two-atlas-texel cross dilation of alpha; this deterministic contrast treatment preserves subpixel segments without changing shared atlas pixels or UVs. Blend primitives do not write depth. All internal lighting, blending and premultiplied box averaging use linear RGB; output is unpremultiplied and sRGB encoded once, then straight-alpha composited over encoded fb contents.