Pencil shading for 3D scenes. Zooming adds new hatch strokes between existing ones; screen-space outlines give the edges a slight pencil wobble.
The hatching builds on Rune Skovbo Johansen's fractal dithering. Each stroke keeps the same identity as the pattern subdivides, so its length and pressure don't reset at every scale change. Darker areas build up overlapping strokes; fully lit areas stay clear.
The outlines use depth and normal samples to find edges, then fit a short line through nearby samples. Width and wiggle are measured in pixels. This follows the screen-space approach described in Manifold Garden's rendering retrospective, with a local line fit and pencil shading added here.
Camera, light and scene changes render continuously. Stroke seeds stay fixed during motion and zoom; there is no temporal blending.
- Drag to orbit; scroll or use Zoom to move closer.
- Scene switches between the city, traffic, sculpture and flat tests.
- Walk through town offers WASD movement and drag-to-look. Capture mouse enables mouse-look; Esc releases it. Touch screens have movement buttons.
- Pencil fit adds outline wiggle. Stable fit removes it.
- Hatching starts below and Full hatching below, in More controls, set the surface-brightness range that produces hatch ink.
- More controls contains the shading comparisons, shadow views and quality settings.
Hatching · Outlines · Rendering · Sources
Start with the shader reading guide for the call order, coordinate spaces and render passes. Shaders are in src/shaders/; the scene and WebGL code are in src/web/. Run python scripts/build.py after editing them. The generated demo also works offline. See tests and build instructions.
The Unity package includes pencil materials, fitted contours, a paper UI shader and a reversible setup window. Install it into a Unity 6000.3.12f1 / URP 17.3 project, then use Tools > Sketchy > Installer. Local testbeds under Unity/ are excluded from Git; only the UPM package is shared. The reference scene uses the same city geometry as the browser.
To install from this repository, use Package Manager's Install package from git URL:
https://github.com/otdavies/sketchy.git?path=/Packages/com.otdavies.sketchy
This first Unity release targets URP 17.3, opaque rigid meshes and independent mono cameras. Setup, architecture and validation describe the current scope and remaining parity work.
MIT license. The tests check stroke identity, immediate updates, contour spikes and shadow visibility.
