inkSketchPen.styleBlock
- .metadata194 B
- README.md4.9 KB
- block.yaml3.4 KB
README.md
Sketchy pen (styleBlock, Line)
A loose, quick sketchbook pen line that wobbles off each edge and back, overshoots the corners and doubles up where the hand went over a line twice: the energy of a travel sketch, concept sketch or urban sketchbook drawing.
Settings: width (1.1), 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.3), strokes (2), wander (2.2), wanderPx (120), overshoot (7), boil (0.25), secondInk (0.7). Low quality draws no contact lines (contact 0) and at most two passes (strokes 2); 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. Each pass finds its edges with one ring of taps on every tier, since several passes already cost more than one line.
It draws each edge with strokes passes (1 to 3), each one an edge search like the pen line's (silhouettes on the near side, folds, colour contacts faded out from 8 to 22 m) moved off the true edge. Each pass wanders by up to wander reference pixels along a path laid on the surface's world position and about wanderPx long in the picture, and runs past the corners by overshoot along the edge's direction on screen, the first pass one way and the second the other. Later passes are lighter (secondInk), and every pass skips here and there along a quick stroke (a fixed pattern about 40 reference pixels long). A small part of each pass (boil) is redrawn on each held step of the shared clock. Width, wander and overshoot all thin with distance from thinNear to thinFar, and the line fades by fadeEnd. It reads the shared ground, the wobble, the held clock and the pigment set; the ink follows the picked ink set by setInk, and 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 every frame, so the passes stay with their edges under any camera move. Each pass's wander and its skips are laid on the surface and keep their size in the picture, so on still things they stay put while the camera moves; on a moving character or prop they come from world position and slide along its outline. The overshoot follows the edge's direction on screen, so it turns with the edge as the camera orbits. The boil redraws a small offset (up to wander x boil reference pixels) on each held step, never per frame: at the looks' hold rate of 8 drawings a second it reads as a nervous, living sketch; set boil to 0 for a still one.
How it treats content
- Opaque things: outlined with one to three loose passes that overshoot corners and double up.
- Transparent things (glass, water): no depth, so glass and water get no line of their own and the edges behind them are sketched 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.
- Sky: never sketched; a silhouette against the sky is drawn on the near side, though a wandering pass can stray a pixel or two onto the sky.
- Fog: lines come from depth, so fog does not thin them; distance does. In thick fog set
fadeEndnear the fog's far distance. - Skinned characters: outlines follow every pose; the wander and skips slide along a moving body, which reads as the sketch being redrawn. Keep it off a character with a group mask if that is distracting, and off toon materials that draw their own outline (toonMaterials' ToonInk) so one thing owns each outline.
- Foliage: every leaf edge drawn two or three times reads as scribbled foliage near the camera, which suits a sketch; far branches can shimmer. Raise
threshold, lowerstrokesorfadeEndfor calmer trees. - World text: doubled, wandering passes make small text hard to read. Exclude labels a player must read by name:
StyleKit.options({ exclude = { "labelName" } }). - Black stays black: it returns through
sk_finish, so the passes only darken 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.