Log inGet started
World

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

README.md

Conte three crayons shade (styleBlock, Tone)

Shades the picture in the three-crayon figure drawing: sanguine for the middle darks, black for the deepest darks and accents, white chalk heightening on the lights, the middle tones left as the tan sheet. Darker places get more strokes laid over the lighter places' strokes; the strokes stay on the surfaces and catch the paper's tooth.

Part of pencilBlocks. Runs the shared pencilShade shader, so every shade block takes the same settings and StyleKit.swap(entry, otherBlock, { keepSettings = true }) carries them across. This variant's own defaults: lead (#9e4b31), deepLead (#1e1c1d), deepFrom (0.6), hardness (0.35), pressure (0.55), tooth (0.75), smudge (0.55), gloss (0), heighten (0.95), heightenFrom (0.76), direction (1), angle (40), strokeLength (70), spacing (9), width (2), layers (5), jitter (0.25), taper (0.4), lightest (0.92), darkest (0.3), toneMiddle (0.66), formShade (0.55).

Pair it with conteThreeCrayonsLine for the same medium's edges, or with any Line block (inkBlocks' pens, styleKit's depthLine). Put it on a paperBlocks paper for the tooth: the strokes catch on the peaks and skip the valleys.

StyleKit.add("conteThreeCrayonsShade", { id = "shade" })
StyleKit.set("shade", { pressure = 0.7, direction = 2 })   -- press harder, cross the strokes

What it gives up in motion

Strokes are laid on the world position of the surface under each pixel, measured in its own tangent plane, so they stay put on still things while the camera pans, dollies, orbits or zooms. To keep their size on screen the pattern is drawn at two octaves (spacing s and 2s) blended by distance: walking closer, strokes grow and new ones fade in between them rather than sliding. On a moving character they slide unless it carries its own marks (PencilHero.paint). The tone that decides how many strokes a place gets changes with the light, so a slowly moving light adds or removes strokes one by one. boil redraws each patch a little on every held step of the shared clock (8 a second in the pencil looks) without changing the tone, so the whole picture never flashes.

How it treats content

  • Opaque things: drawn by light, with localTone of each material's own darkness; lit planes are left as bare sheet and shade builds up stroke by stroke. Textures (brick, planks, grass) cancel out of the light, so they do not print as strokes; detail brings some back.
  • Transparent things (glass, water): not in the depth, so strokes are laid on what is behind them.
  • Particles and smoke: not in the depth; they take the strokes of the surface behind them.
  • Sky: left as bare sheet with sky of its tone rubbed in as a light smudge; no strokes.
  • Fog: thickens the value toward light, so foggy distance gets fewer strokes; past fadeEnd strokes give way to a soft rubbed tone.
  • Skinned characters: strokes are laid on world positions, so they slide over a character that moves. Paint the character with PencilHero.paint (it carries the same marks on its own position) and keep this block off it with a group mask.
  • Foliage: alpha-tested leaves are in the depth and take strokes like any surface; very fine foliage reads as tone.
  • World text: exclude labels a player must read (StyleKit.options({ exclude = { ... } })); the block leaves them as rendered.
  • Black stays black: with every light off the frame stays black; sk_finish holds every pixel at or below the value the scene gave it.

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.