Style Cookbook: Mix Your Own Art Style from Stackable Look Blocks
- ..
- .metadata168 B
- README.md5.1 KB
- block.yaml2.1 KB
README.md
Pooled black (styleBlock, Fill)
Deep shadow settles into solid black ink with a ragged edge, and ink gathers where things meet the ground: the bold spotted blacks of noir ink, comics and woodcut-like ink illustration. On a dark ground with white ink it leaves deep shadow as bare ground.
Settings: ink (#0a090a), setInk (1), threshold (0.22), softness (0.06), ragged (0.5), raggedSize (1.5), contact (0.7), contactSize (0.5), sheen (0.15), fadeEnd (80), wobble (1). Low quality gathers no ink at contacts (contact 0); like every block it runs at half resolution there, and since the low tier makes no copy of surface colour, light is judged from the drawn brightness, so a dark material in full light (black paint, dark wood) can pool as if it were in shadow.
It reads the frame, depth, the copied surface colour (albedo), the frame as rendered, the wobble and the pigment set. How much light reaches a pixel is the frame as rendered against its own surface colour, averaged over five taps 3 reference pixels apart (texture cancels, so a dark texture in sun is not shadow); with no surface colour copy it is the drawn brightness. Where light falls below threshold (about 1 is full light), with a soft edge of softness made ragged by a noise laid on the surface (ragged, raggedSize), the shadow fills with solid ink. Ink also gathers where something stands on a surface facing up (the foot of a wall, under a crate): it looks up the picture for a surface a little higher within contactSize metres across the ground, whichever way the light falls (contact). A pool is not perfectly flat: sheen shows thinner, lighter patches in it. Pools only darken what is there, and fade out over the last third of the way to fadeEnd. The ink is ink, or the picked ink set's first paint by setInk; with a light ink (inkWhiteOnDark) deep shadow becomes the set's dark ground instead. It sits after the wash in the ink Fill chain (rank 40, stacking chain), the same rank as watercolorBlocks' wcShadowPool, so StyleKit.swap("shadow", "inkPool") trades watercolor's coloured shadows for spotted blacks in one change. Its reads lists ground, but this shader does not read the shared ground: pools are the same on any paper.
What it gives up in motion
Pools follow the light the renderer drew each frame, so they move with shadows and stay on things under any camera move: a moving shadow carries its pool with it, and a shadow edge sweeping slowly over a surface moves the pool edge smoothly. The ragged edge and the sheen are laid on surfaces in world position, so they slide across moving characters. Contact pools are found by looking up the picture, so seen from straight above (a top-down camera) there is little above to find and they thin out. Thin shadows from far, thin things (railings, branches) can shimmer at the pool's hard edge, so pools fade out by fadeEnd.
How it treats content
- Opaque things: surfaces in deep shadow turn solid black with a ragged edge; lit surfaces are left as they came.
- Transparent things (glass, water): not in the surface colour copy, so the light estimate reads the rendered pixel (glass included) against the surface behind; dark tinted glass can pool. A water surface pools like its bed.
- Particles and smoke: dark smoke over a lit floor lowers the light estimate and can pool solid black through the smoke; bright sparks and glows lift the light and never pool. Keep dark smoke effects light or mask the pool there.
- Sky: never pooled.
- Fog: fog brightens the rendered colour, so far shadows pool less, and pools are gone by
fadeEnd(80 m), so the far distance stays light. - Skinned characters: a character in deep shadow becomes a black silhouette, which suits noir but can hide the player; keep this block off the player with a group mask (
StyleKit.setMask("pool", { kind = "group", group = 1, invert = true })). The ragged edge slides on a moving body. - Foliage: the dark undersides of trees and the shade under a canopy become black masses, and dappled light gives ragged spotted blacks.
- World text: on high and medium dark lettering in light is not shadow and stays as it is; on the low tier dark text can pool. Exclude labels a player must read by name:
StyleKit.options({ exclude = { "labelName" } }). - Black stays black: it returns through
sk_finishand pools only darken, so an unlit pixel stays black; with white ink the dark ground it lays is held at black where the scene had no light.
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.