Repository navigation
Description
Here is a standardized section for the Substrate Algorithm, formatted to fit directly into your Growth Algorithms section alongside models like Differential Growth, DLA, and Physarum.
A procedural 2D line-drawing algorithm created by Jared Tarbell that simulates crack propagation and stress relief. Crack fronts travel across a plane in straight or slightly drifting lines until they intersect an existing crack line, at which point they stop, form a perpendicular
Key Characteristics & Behaviors:
- Path Termination: Cracks stop propagating immediately upon colliding with another crack line, naturally generating enclosed polygonal cells (craquelure/dry glaze aesthetic).
-
Perpendicular Spawning: New crack branches emerge at right angles (
$90^\circ$ ) from existing lines, mimicking mechanical shear relief along structural weakness planes. - Non-Physical Heuristic: Does not calculate stress tensors or continuum physics; relies purely on directional vectors, spatial lookup grids, and collision queries for blazingly fast execution.
Algorithmic Definition:
-
Initialization:
- Create a 2D spatial lookup grid (or canvas pixel map) to track cracked vs. uncracked space.
- Seed an initial array of crack agents with a 2D position
$(x, y)$ and a direction angle$\theta$ . Mark their starting positions as cracked in the spatial grid.
-
Per-Tick Agent Update (for each active crack tip):
- Calculate the next candidate step position:
$\vec{p}_{next} = \vec{p} + \begin{bmatrix} \cos(\theta) \\ \sin(\theta) \end{bmatrix} \cdot v$(where$v$ is step velocity/step size)*. -
(Optional) Add a small amount of angular drift (
$\theta \leftarrow \theta + \Delta\theta$ ) to introduce organic curvature or simulate local material grain. - Query the spatial grid at
$\vec{p}_{next}$ :-
If uncracked: Mark
$\vec{p}_{next}$as cracked in the spatial grid, update agent position$\vec{p} \leftarrow \vec{p}_{next}$, and draw a segment line. - If cracked (Collision Detected): Terminate the active crack agent (stop updating it).
-
If uncracked: Mark
- Calculate the next candidate step position:
-
Branching & Spawning (Per-Tick or Event-Driven):
- Select a random previously drawn crack line point
$\vec{p}_{source}$. - Check if the maximum number of simultaneous active cracks has been reached. If not, spawn a new crack agent at
$\vec{p}_{source}$. - Set the new agent's direction angle
$\theta_{new}$ to be perpendicular to the tangent of the parent line at$\vec{p}_{source}$ ($\theta_{parent} \pm 90^\circ$).
- Select a random previously drawn crack line point
-
Optional Constraints & Variations:
- Sand Painting / Color Infill: As crack tips move, draw fine perpendicular color gradient lines extending sideways to shade the "cracked regions" (the classic Jared Tarbell visual style).
-
Variable Angle Deviation: Allow spawning angles to fluctuate around
$120^\circ$ instead of$90^\circ$ to emulate uniform shrinkage networks (drying mud/basalt columns). - Curved Substrates: Map the 2D grid/collision lookups onto UV space or 3D mesh surfaces to simulate organic surface cracking on complex volumes.
Here is a curated collection of key links, open-source repositories, influential generative artworks, and environment-specific add-ons for the Substrate Algorithm and procedural crack/fracture simulation.
Key Links & Articles:
- Jared Tarbell’s Original Substrate Gallery & Statement — The original 2004 showcase by Jared Tarbell on Complexification.net detailing the visual mechanics, interactive applets, and philosophy behind the algorithm.
- Inigo Quilez’s Voronoi Edges & Shattering — A deep dive by shader expert Inigo Quilez on computing exact distances to Voronoi cell boundaries for fast shader-based crack lines.
- Alan Zucconi’s Crack Propagation and Fracture Series — Detailed technical tutorials breaking down the mechanics of procedural fractures and breakable geometry in real-time graphics.
Code Repositories & Implementations:
- Matt DesLauriers (
mattdesl) Substrate Implementation — Clean, dependency-free JavaScript/p5.js implementation of the Substrate crack growth algorithm. - p5.js Web Editor Substrate Examples — Editable, browser-ready sketches of Substrate in p5.js showing both raw crack paths and classic sand-painting color infills.
- Processing Java Substrate Implementations — Look for community ports of Substrate in the Processing sketch archives or OpenProcessing search results for high-performance Java variants.
- ShaderToy: Procedural Crack Shaders — GPU-based implementations of crack lines, craquelure, and Voronoi fragmentation running entirely in GLSL.
Notable Art Projects:
-
Complexification / Substrate (2004) by Jared Tarbell — The foundational generative artwork that defined the aesthetic of
$90^\circ$ T-junction crack networks and fine-line color fills. - Process 4 / Process 14 by Casey Reas — Early generative art systems exploring emerging network structures, line interactions, and space-partitioning behaviors closely related to growth-based crack paths.
- Dendrytics & Crackle Series by Quayola — Digital sculptures and computational animations that utilize dynamic mesh cracking and Voronoi fragmentation on classical statues and organic forms.
Add-ons & Libraries for Creative Coding Environments:
- Processing (Java)
- HE_Mesh (by WBLUT) — High-performance 3D mesh library for Processing; includes native support for Voronoi cell slicing, dynamic plane clipping, and mesh fragmentation.
- toxiclibs — Includes
toxi.geom.meshfor splitting 3D geometries andtoxi.physicsfor mass-spring lattices that break under tension.
- p5.js / JavaScript
- d3-delaunay — Blazingly fast 2D Voronoi and Delaunay calculations used to generate instant impact fractures and polygonal tiles.
- Matter.js — Standard 2D physics engine for JS; pair it with procedural crack paths to break single rigid bodies into interactive physics-driven shards.
- Houdini
- SideFX Houdini RBD Material Fracture — Native production node suite combining Voronoi, wood grain, and glass fracture patterns with constraint networks.
- Blender
- Blender Cell Fracture Addon — Built-in Blender addon that uses Voronoi noise and point clouds to shatter meshes into distinct 3D fragments.
Activity