Log inGet started
World

Style Cookbook: Mix Your Own Art Style from Stackable Look Blocks

README.md

Dip nib line (styleBlock, Line)

A flexible dip pen nib line whose width swells and thins with the direction of the stroke and opens up on curves and in shadow: the lively thick-and-thin line of crow-quill and steel-nib ink drawing, engraving-like illustration and old book plates.

Settings: width (2.4), 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.9), hairline (0.3), nibAngle (0.8), flex (0.35). 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, colour contacts faded out from 8 to 22 m) and reads the shared ground, the wobble and the pigment set. Before it draws, eight depth reads at the pixel tell which way the nearest edge runs on screen. A stroke that runs across the nib (held at nibAngle on the picture) lays the nib's full breadth, width; one that runs along it is a hairline of hairline x width; where no edge direction can be told, the nib lays its full breadth. The nib also opens up on curved surfaces (curve) and where the picture is dark (flex, the hand pressing harder). Distance thins it from thinNear to thinFar and fades it by fadeEnd. The ink follows the picked ink set by setInk; a watercolor set leaves the line its own ink. It has no boil of its own and swaps in one change with the other ink lines and with depthLine and sketchLine.

What it gives up in motion

The line is found again every frame from depth, so it stays on its edges under any camera move. The thick and thin follow each edge's direction on screen, not on the surface: as the camera orbits an object a line turns smoothly from broad to hairline, the way the drawing itself would change if drawn again from there, but it does mean the weight along one edge changes while you circle it. Very short edges can pick a direction badly and read a little broad. Nothing is laid on surfaces except the paper break, which follows the shared tooth and slides along a moving character. With a Time block the line trembles with the stack on the held clock, never per frame.

How it treats content

  • Opaque things: outlined in thick and thin, broad across the nib, hairline along it, opened up on curves and in shadow.
  • Transparent things (glass, water): no depth, so glass and water get no line of their own; the edges of what is behind them are drawn 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, and a little broader where the smoke darkens the picture.
  • 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. In thick fog set fadeEnd near the fog's far distance.
  • Skinned characters: the outline follows every pose, and its thick and thin turns as the limbs turn, which reads as drawn rather than sliding. Keep it off toon materials that draw their own outline (toonMaterials' ToonInk) with a group mask, so one thing owns each outline.
  • Foliage: many short leaf edges each pick a direction, so a near tree becomes a crowd of hatched-looking strokes; far branches can shimmer. Raise threshold or lower fadeEnd for calmer trees.
  • World text: outlined like any shape; the hairlines keep small letters a little more open than the brush, but labels a player must read belong in StyleKit.options({ exclude = { "labelName" } }).
  • Black stays black: it returns through sk_finish, so the nib only darkens what is there and an unlit pixel stays black; with white ink, lines 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.