Log inGet started
Package

inkBrushLine.styleBlock

README.md

Brush line (styleBlock, Line)

A pointed ink brush line that tapers at both ends of every stroke and swells with pressure, heavier in shadow and on curves and thinner in the distance: the living line of brush and ink drawing, ink wash painting and bold illustration.

Settings: width (3.6), ink (#0f0e0f), setInk (1), opacity (1), silhouette (1), crease (0.8), creaseAngle (0.3), contact (0.45), threshold (0.02), thinNear (4), thinFar (45), farWidth (0.35), fadeEnd (140), paperBreak (0.1), wobble (1), curve (0.6), taper (0.18), strokePx (90), pressure (0.6), lift (0.1), boil (0.15). Low quality draws no contact lines (contact 0) and finds edges with one ring of taps instead of two; like every block it runs at half resolution there, and with no copy of the surface's colour and normals creases come from depth alone (so only within 25 m) and curves are not weighted.

It finds edges the same way as the pen line (silhouettes on the near side only, folds from depth kinks and copied normals, colour contacts faded out from 8 to 22 m) and reads the shared ground, the wobble, the held clock and the pigment set. What makes it a brush is the stroke: a noise laid on the surface's world position and kept about strokePx reference pixels long in the picture (two sizes blended by distance) sets where each stroke swells to full width and where it falls to taper of it, and where the noise is lowest the brush lifts off and leaves a small gap (lift). Where the picture is dark the hand presses harder and the line grows by up to pressure x 0.6; on curved surfaces it grows by curve. Distance thins it from thinNear to thinFar (down to farWidth) and fades it out by fadeEnd. The ink follows the picked ink set by setInk, as every inkBlocks line does; a watercolor set leaves the line its own ink. It swaps in one change with the other ink lines and with depthLine and sketchLine.

What it gives up in motion

The edges are found again every frame, so the line stays on them under any camera move and follows moving things. The stroke rhythm (where a stroke swells, tapers and lifts) is laid on the surface and keeps its length in the picture: on still things it stays put while the camera pans, dollies or orbits, and as you walk closer it grows into the next size of stroke rather than sliding. On a moving character or prop the rhythm comes from world position, so the swells slide along the body's outline while it moves. With boil above 0 the rhythm shifts a little on each held step of the shared clock (never per frame); the default 0.15 reads as a calm living line, higher values as a restless one. Lines thinner than a pixel on far, thin things can shimmer, so they thin and fade with distance.

How it treats content

  • Opaque things: outlined with tapered, swelling strokes, heavier in shadow and on curves.
  • Transparent things (glass, water): no depth, so glass and water get no line of their own and the edges behind them are brushed through them, over their colour.
  • Particles and smoke: no outline around smoke or sparks; lines of things behind soft smoke are drawn on top of it. Dark smoke makes the picture darker, so lines behind it press a little heavier.
  • Sky: never inked; a silhouette against the sky is drawn on the near side.
  • Fog: lines come from depth, so fog does not thin them; distance does. With thick fog, set fadeEnd near the fog's far distance.
  • Skinned characters: the outline follows every pose; the swell and taper pattern slides along a moving body. Keep it off a character with a group mask if that reads wrong, and off toon materials that draw their own outline (toonMaterials' ToonInk) so one thing owns each outline.
  • Foliage: leaf edges brush into lively clumps near the camera, which suits ink painting; far branches can shimmer. Raise threshold or lower fadeEnd if trees read too busy.
  • World text: outlined like any shape, and the heavy default width fills small letters in. Exclude labels a player must read by name: StyleKit.options({ exclude = { "labelName" } }).
  • Black stays black: it returns through sk_finish, so the brush only darkens what is there and an unlit pixel stays black; with white ink, strokes on parts that get no light at all are held black too.

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.