Style Cookbook: Mix Your Own Art Style from Stackable Look Blocks
- ..
- .metadata147 B
- README.md3.4 KB
- block.yaml2.9 KB
- preview.png460 KB
README.md
Toon outline (styleBlock, Line)
A thin dark ink line round every object, the classic cel-shaded outline.
The default line: 2.5 reference pixels of near-black ink (#0f0d14), even everywhere.
Every toonBlocks line block draws the same toon ink line on the engine's own outline effect and shares the same settings (width, units, colour, tint, tintDarken, outerWidth, outerColour, fadeStart, fadeEnd, minWidth, smoothing, skipOwnInk, lowDistance, targets, brush, brushAngle, softness, opacity), so switching ink is one name: StyleKit.swap("line", "toonOutline"). Per-object ink (ToonBlocks.setObjectOutline, including { style = "toonOutline" } for one object), per-material rules (ToonBlocks.setMaterialOutline), group, sphere and depth masks and the stack's exclude list all work with it. See the guides "Tuning toon outlines and light for games" and "How to keep a toon look fast in a big game".
What it gives up in motion
The line is found every frame from the frame's own depth (characters: from a hull on their own skeleton), so it never slides, swims or boils as things move or the camera turns, and holds its width in the picture at any distance (or thins as fadeStart, fadeEnd and units say). A thing that appears is drawn round on the frame it appears and loses its line the frame it goes. It is antialiased at full resolution, so a slow camera does not make it crawl. A depth mask and the low tier's lowDistance cut the line per pixel at their distance, so a line ends where the distance is crossed rather than switching a whole object at once.
How it treats content
- Opaque things: a line outside each silhouette, over what stands behind, and round a part standing in front of another (any step in depth of 6 cm, or 3 percent of the distance, whichever is more). Hard-edged and multi-part models close into one line at every corner. A wall or floor in front hides the line exactly where it hides the object.
- Transparent things (glass, water): no line of their own, and they do not cut lines seen through them.
- Particles and smoke: no line; smoke in front covers the line as it covers the object.
- Sky: never outlined; an object against the sky gets its line over the sky.
- Fog: the line is not fogged by itself; thin far lines with
fadeStartandfadeEndor cut them with a depth mask in a foggy distance. - Skinned characters: an inverted hull on the character's own skeleton, so the line follows every pose and also draws the lines inside the body (an arm in front of the chest).
- Foliage: cut-out leaf cards that write depth get a line of their shape, see-through leaves get none; switch leaf materials off per material.
- World text: text gets no line; a sign's card does.
- Black stays black: when nothing in the scene gives light the line is drawn black, whatever its colour.
Known limits
- It runs on the whole frame after antialiasing, so offscreen captures, mirrors and render-to-texture cameras do not show it (#17427).
- Per-object settings (a style channel or a game role) reach it through the shared object mask, at most eight distinct settings a scene. A per-object value cannot reach a geometry pass, so a per-object look that needs one draws passes of its own (#24549).
- Its passes are queued again every frame, even when nothing changed (#24548).
The package README's Known limits lists the rest.