Instanced Geometry
GPU hardware instancing — drawing many copies of one mesh in a single call — entered real-time graphics APIs (OpenGL / Direct3D) in the mid-2000s with programmable pipelines. A rendering primitive rather than an attributable artwork technique.
community / folk Name — A descriptive category label, not a coined or eponymous name; no single coiner of the term is attested.
In one line A 3D technique that draws many copies of one geometry in a single GPU call, each with its own transform — the efficient way to render forests, particle clouds and voxel fields by the thousand.
The code
The actual sketch behind the demo above — sandboxed and reproducible. This is the whole thing.
instanced-geometry/index.html
const SEED = Math.floor(Math.random()*1e9);
// A dense field of identical boxes (the "instanced" primitive) on a grid,
// each extruded in height by a noise field — a rotating 3D bar-chart cityscape.
let GN, hueBase;
function setup() {
randomSeed(SEED); noiseSeed(SEED);
const s = Math.min(windowWidth, windowHeight);
createCanvas(s, s, WEBGL);
colorMode(HSB, 360, 100, 100);
GN = 22;
hueBase = random(360);
}
function draw() {
background(230, 50, 10);
const s = width;
ambientLight(0, 0, 30);
directionalLight(0, 0, 90, 0.3, 0.7, -0.5);
pointLight((hueBase+40)%360, 50, 100, 0, -s*0.3, s*0.4);
rotateX(-0.9);
rotateZ(frameCount * 0.004);
const span = s * 0.7;
const step = span / GN;
const t = frameCount * 0.01;
noStroke();
for (let i = 0; i < GN; i++) {
for (let j = 0; j < GN; j++) {
const nx = i/GN, nz = j/GN;
const hgt = (noise(nx*2.2 + t, nz*2.2) ** 2) * s * 0.6 + 2;
push();
translate(-span/2 + i*step + step/2, 0, -span/2 + j*step + step/2);
translate(0, -hgt/2, 0);
ambientMaterial((hueBase + hgt*0.25) % 360, 60, 90);
box(step * 0.82, hgt, step * 0.82);
pop();
}
}
}How it works
Upload the base mesh (vertices/indices) once, then supply a per-instance attribute buffer holding each copy's parameters — typically a 4×4 transform matrix plus colour/scale: 1. Build the instance buffer on the CPU (or in a compute/GPGPU pass): a position, rotation and scale for every copy, often placed by noise, a grid, or a packing. 2. Issue one instanced draw call for N instances; the vertex shader reads gl_InstanceID / the per-instance attributes and transforms the shared mesh into place. 3. The GPU renders all N without per-object CPU overhead, so counts in the tens or hundreds of thousands stay real-time. Animating just the instance buffer (not the geometry) moves the whole field cheaply.
Parameters
instanceCount: number — Number of copies drawn in a single batched call.baseGeometry: string — The mesh replicated per instance (box, sphere, etc.).transforms: array — Per-instance position/rotation/scale applied to the base mesh.
Lineage
Frequently combined with
- Fragment Shader (GLSL) · 13 works
- 3D Mesh / Geometry · 12 works
- Perlin / Simplex Noise · 8 works
- Raymarching with SDFs · 3 works
- Geometric / Hexagonal Tiling · 2 works
- Bezier / Catmull-Rom Splines · 2 works
- Plotter-style Hatching · 2 works
- Glitch / Datamosh · 2 works
- Dithering · 1 work
- Strange Attractor · 1 work
- Boids / Flocking · 1 work
- Quadtree / Recursive Quad Split · 1 work
Works using this algorithm (18)
Last updated 2026-07-16