toonBlocks.package
- ..
- .metadata151 B
- README.md5.2 KB
- block.yaml2.6 KB
- preview.png458 KB
This package holds more than this page lists. See all of its files in its world.
README.md
Cel fill (styleBlock, Fill)
Flat cel fill for the whole frame: each area of colour laid flat like cel paint, the texture detail inside it let go, and the light split into a lit tone and a shadow tone of a chosen colour.
Settings: flatten (0.85), radius (24), keepEdges (3), saturation (1.1), posterLevels (0), threshold (0.42), softness (0.02), shadowColour (#9e94db), shadowLevel (0.6), litLevel (1), hueShift (0), shadowSaturation (1), lightWarmth (0), keepLight (0), shape (0.9), shadeLevel (0.3), castBelow (0.8), fullLight (1), keepLightColour (0.3). Low quality gathers colour from radius 10 with four taps per ring instead of eight.
The area's colour is the surface's base colour (the deferred renderer's copy), averaged over two rings of taps out to radius reference pixels that lie on the same surface (same distance, same facing) and are close in colour, so texture detail goes by flatten while clear colour changes (a door in a wall) stay as edges by keepEdges. saturation and posterLevels (2 to 6 values, like poster paint) shape the flat colours. The light is read as the other toonBlocks blocks read it (the frame over the base colour, smoothed by flatten, redrawn as a clean sun light by shape, shadeLevel and castBelow) and split at threshold, softness wide: above it the lit tone (litLevel, turned warmer by lightWarmth), below it the shadow tone (the area's colour times shadowColour at shadowLevel, turned round the colour wheel by hueShift and saturated by shadowSaturation). keepLight 1 keeps the light the Light block before it made (bands, a ramp) inside the flat colours instead of the two tones, which is how the looks stack Toon bands with a cel fill. The Hue-shift cel fill (celHueShift) and the Two-tone poster fill (celPoster) are this block with other defaults, so they swap in one change and settings keep their meaning: StyleKit.swap("fill", "celPoster").
It needs the base colour copy: on the forward renderer, and on the sky and pure black surfaces, it leaves the frame as it is.
What it gives up in motion
Flat areas are steady: with the texture let go there is less fine detail to shimmer, and the colour is gathered again every frame, so it stays on its surfaces under any camera move and follows moving and animated things. The line between the lit and shadow tones follows the light, so it sweeps across a surface when the sun or a lamp moves; the sun's direction reaches the block about once a second, so under a moving sun that line moves in small steps. The gathering reach is sized in reference pixels, so as the camera closes in on a wall the same reach covers less of it and a little more texture shows; colour edges near silhouettes can wobble by a pixel or two as things move in front of each other.
How it treats content
- Opaque things: laid flat in their own colours, two tones each, texture detail let go.
- Transparent things (glass, water): they keep no base colour of their own, so the pixel is painted as the flat surface behind, with the pane's tint and reflections counted only as light: glass and water mostly lose their own look under the fill. Leave panes and water out by name with
StyleKit.options({ exclude = { ... } })where they matter. - Particles and smoke: also painted as the surface behind, their brightness counted as light: a bright spark patch becomes the lit tone, smoke pushes the surface into its shadow tone, and their own colour is mostly lost. Leave effects that must keep their colour out by name.
- Sky: never touched.
- Fog: the base colour carries no fog, so distant surfaces are painted in their own flat colours and the haze is mostly painted out; fog only dims or lifts the light that picks the tone. Limit the block with a depth mask (
StyleKit.setMask("fill", { kind = "depth", near = 0, far = 60, soft = 0.3 })) to keep far haze. - Skinned characters: flattened every frame in their own colours, and a limb in front of the body keeps its own colour because taps must share its distance and facing; the tone line follows every pose.
- Foliage: each alpha-tested leaf is laid flat on its own; small leaves far away give the gathering little to average, so a distant canopy keeps some speckle.
- World text: letters a clear colour away from their card stay as edges, but small text can soften and words in shade take the shadow tone. Leave labels out by name:
StyleKit.options({ exclude = { "labelName" } }). - Black stays black: no light stays no light (the tones only exist where light arrived) and it returns through
sk_finish, so with every light off the frame is black.
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.