inkBlocks.package
- ..
- .metadata161 B
- README.md7.4 KB
- block.yaml3.6 KB
This package holds more than this page lists. See all of its files in its world.
README.md
Ink wash (styleBlock, Fill)
Lays the picture in a few tonal steps of diluted ink on bare paper, lit planes left as paper and shadow washed, with wet edges a little darker where each wash dried, fading to bare paper with distance and low mist: the base of ink wash painting, brush and wash, and monochrome ink illustration. Swaps for the watercolor wash in one change.
Settings: ink (#0f0e0f), setInk (1), steps (4), softness (0.22), whitePoint (0.8), darkest (0.85), contrast (1.15), localTone (0.45), lightFull (0.85), abstraction (0.7), grade (0.3), gradeSize (0.25), granulation (0.25), edgePool (0.4), fadeStart (15), fadeEnd (90), mist (0.5), mistFrom (25), mistHeight (2), sky (0.1), accent (1), accentPick (0.6), wobble (1). Low quality draws no granulation (granulation 0); like every block it runs at half resolution there and reads the soft field at half of that, and since the low tier makes no copy of surface colour, the tone there is the drawn brightness rather than light, so a texture that the light estimate would cancel shows as tone.
It reads the frame, depth, the soft field, the copied surface colour (albedo), the frame as rendered, the shared ground and wobble, and the pigment set. The tone comes from light, the way an ink painter works: how much light reaches each surface is the frame as rendered against the surface's own colour (two images aligned pixel for pixel, so a brick wall in sun reads as one lit plane), summed over three rings out to 24 reference pixels before dividing so a texture's pattern cancels in bulk, and divided by lightFull. A share of the surface's own tone (localTone) is added so dark materials still carry ink, read from the soft field's wide ring so no texture finer than the brush reaches it; at 0 every lit plane is paper. Whatever is cut into steps has to be smooth already: texture left in it flips pixels across a step's edge and prints a grid of dots, which is why both are read wide. Where light cannot be told from colour (the low tier, the forward path, the sky) the drawn brightness is used instead, after texture inside a surface is let go into the soft field (abstraction). Everything at or above whitePoint is bare paper; the rest is pushed apart by contrast and cut into steps washes with soft edges (softness) and a slightly darker rim on the dark side of each edge where the wash dried (edgePool). The wash lies unevenly across a surface (grade, gradeSize, laid on the world position), settles into the shared paper's tooth (granulation), thins to paper from fadeStart to fadeEnd, and thins in low mist: below mistHeight metres of world height (fully at a quarter of it) and from about mistFrom metres away. The sky takes sky of its own tone. Ink is laid in optical density, so a diluted wash keeps the ink's own hue (sepia dilutes to tea browns, blue-black to slate). The ink is ink, or the picked ink set's first paint by setInk; only an ink set counts (its first paint very dark or very light and its pull below 0.35), so a watercolor palette never recolours the wash. With a set carrying a second paint (inkRedAccent's vermilion), things of that hue keep the accent (accent, and accentPick from anything near the hue to only strongly coloured paint of it). With a light ink (the inkWhiteOnDark set) it works the other way round: the set's shadow colour is the dark ground and white ink is laid only where the light is strongest. It is the first block of the ink Fill chain (rank 10, stacking chain), the same rank as watercolorBlocks' wcWash, so StyleKit.swap("wash", "inkWash") turns a watercolor stack's wash into ink in one change (settings reset; strength and mask stay).
What it gives up in motion
The tone is read from the picture's own light every frame, so washes stay on things under any camera move and move with shadows: a moving shadow carries its wash with it. The abstraction reads the soft field, a screen-space blur made each frame, so it follows moving things. The grading and the tooth's settling are laid on surfaces in world position: still on still things, they slide across moving characters and props. Step edges are soft (softness), so a slow light change moves a wash edge smoothly; with a very hard edge (the noirInk look's 0.06) a slowly moving sun sweeps a crisp edge across a surface, and light that flickers near a step (noisy shadows, aliased shadow edges) can shimmer there. The distance fade and the mist follow view distance and world height smoothly. With a Time block the wash edges tremble on the held clock (wobble), never per frame.
How it treats content
- Opaque things: lit planes go to paper, shadow and dark materials are washed in steps; every colour becomes the ink's, except things of the accent's hue when the set carries one. Colours that carry gameplay meaning are lost: keep them with a group mask or
exclude. - Transparent things (glass, water): they are not in the depth or the surface colour copy, so the light estimate reads the rendered pixel (glass included) against the surface behind; tinted glass reads as shade and is washed darker, clear glass vanishes into the wash behind it. A water surface is washed as its bed, and misted by the bed's height.
- Particles and smoke: no depth or surface colour of their own; dark smoke lowers the light estimate and is washed as shadow, bright sparks and glows lift it past
whitePointand become bare paper. Small bright gameplay effects can vanish: make them big, or keep them out with a mask orexclude. - Sky: takes
sky(0.1) of its own tone, so it is nearly bare paper with a hint of the sky; the accent is never kept on the sky. With white ink the sky stays close to the dark ground. - Fog: fog brightens the rendered colour, so fogged distance washes paler;
fadeStart,fadeEndand the lowmistthin it to paper anyway, which reads as ink painting's misty distance. - Skinned characters: washed by their light like everything else, their own colour adding tone by
localTone; the grading slides across a moving body. A character masked out of the wash with a group mask keeps its rendered colour on the ink page, which reads as a colour cut-out: often what a game wants for the player. - Foliage: leaf masses become one or two tone shapes, which reads as painted trees; sunlit leaves go to paper, the shaded inside of a canopy is washed.
- World text: lettering is turned into ink tones and small text is averaged by
abstraction. Exclude labels a player must read by name:StyleKit.options({ exclude = { "labelName" } }). - Black stays black: it returns through
sk_finish, so an unlit pixel is never lifted toward paper; with white ink on a dark ground the parts of the scene that get no light at all stay 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.