Log inGet started
Package

pencilBlocks.package

This package holds more than this page lists. See all of its files in its world.

README.md

Coloured pencil underlayer (styleBlock, Fill)

A light first layer of coloured pencil: each thing's own colour laid in soft, even, light-pressure strokes that follow the form over a pale blank of the picture, the way a coloured pencil drawing is started. Graphite, coloured pencil or ink is then drawn over it.

Part of pencilBlocks. Runs the shared pencilFill shader with strokes = 1; sketchBlankFill is the same shader with no strokes. Its strokes come from styleKit's shared stroke piece (skStrokes) through pencilCore, like every pencil shade block, so hardness, pressure, tooth, direction, angle, strokeLength, spacing and layers mean the same here as there.

local StyleKit = require("~styleKit.StyleKit")
StyleKit.applyLook("pencilSketch")
StyleKit.add("coloredPencilUnderlayFill", { id = "fill" })   -- colour first, lightly
StyleKit.set("shade", { over = 1 })                           -- graphite over the colour
StyleKit.set("fill", { direction = 0, pressure = 0.45 })      -- follow the form, press a little harder

What it gives up in motion

Its strokes are laid on the world position of the surface under each pixel and kept at screen size by octaves blended by distance, so they stay put on still things while the camera pans, dollies, orbits or zooms, and grow into the next octave instead of sliding. boil redraws each patch a little only on the shared held clock, never per frame; the colour under it never changes with it.

How it treats content

  • Opaque things: lifted toward the bare sheet by paleness, keeping keepColour of their colour; the underlayer's strokes are laid in each thing's material colour, greys getting only a little.
  • Transparent things, particles and smoke: lifted like everything else, pixel by pixel; strokes are laid on the surface behind them.
  • Sky: lifted at least skyBare of the way to the sheet; no strokes.
  • Fog: lifted with what is behind it, so foggy distance goes toward the bare sheet; past fadeEnd the underlayer's strokes give way to a soft tone.
  • Foliage: alpha-tested leaves are in the depth and are treated 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.
  • Skinned characters: the blank is pixel by pixel and travels with them; the underlayer's strokes are laid on world positions, so keep it off a moving character with a group mask, or paint the character with PencilHero.paint.
  • Dark sheets (black paper, the boards): the blank sinks toward the sheet instead of toward white.
  • Black stays black: only what light reached is lifted, so with every light off the frame stays 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.