Painterly rendering for animation (Meier)
Anchors brush-stroke particles to the 3D surface so strokes move with the object, avoiding the shower-door swimming of per-frame 2D painterly filters.
In the family Stylized & non-photorealistic rendering, painterly rendering
Where it runs
Built inOfficial add-onPluginNone foundNot researched
| Engine | Support | How |
|---|---|---|
| three.js r187 | None found | |
| Babylon.js 9.38.0 | None found | |
| Godot 4.7 | None found | No built-in particle-attached painterly brush-stroke renderer. |
| Unity | None found | |
| Unreal 5.7 | None found | No built-in particle-attached painterly brush-stroke renderer. |
| Blender 5.2 | None found | |
| WebGPU W3C | None found | |
| Metal | None found |
How it works
Particles are scattered over the 3D surfaces, in proportion to their projected area so density in screen space stays near-uniform. Each particle stores a position, colour taken from the lit surface, and stroke attributes. Every frame, the particles are projected, sorted by depth, and each is rendered as a textured, rotated and scaled brush-stroke sprite, with randomised jitter from a reference image. Because particles belong to the geometry, strokes remain consistent as objects and camera move. Stroke size, orientation, and density are controlled per-surface, and ordering along view depth makes paint layering look natural.
When to choose it
Reach for it when
- painterly filter swims over moving 3d objects
- brush strokes should stick to the surface in animation
- per-frame painting causes flicker
- painted look with frame-to-frame coherence
- shower-door effect in stylised animation
Choose it for painterly 3D animation where frame-to-frame coherence is essential. Prefer Painterly rendering with curved brush strokes for rendering strokes from a single image with curved paths, and Anisotropic Kuwahara filter for a cheap screen-space look at the cost of swimming.
Field marks
- Stroke popping when particle density changes with distance
- Strokes of fixed size look wrong at large zoom
- Needs a surface sampling strategy for non-manifold or thin geometry
- Per-frame depth sorting of thousands of sprites costs overdraw
Presets
Painterly Animation (Meier 1996) — 2D screen-space shower-door swimming (left) vs 3D surface-anchored brush particles (right)
{
"P_STROKE_DENS": 9,
"P_BRUSH_LEN": 0.75,
"P_ROT_SPEED": 0.55,
"P_SPLIT": 0.48
}Show GLSL (130 lines)
const float P_STROKE_DENS = 9.00; // P Brush Particle Density [5.0, 15.0, 1.0]
const float P_BRUSH_LEN = 0.75; // P Stroke Length [0.3, 1.4, 0.05]
const float P_ROT_SPEED = 0.55; // P Object Rotation [0.0, 1.6, 0.05]
const float P_SPLIT = 0.48; // P 2D Swim / 3D Anchored [0.0, 1.0, 0.02]
float hash21(vec2 p) {
p = fract(p * vec2(127.1, 311.7));
p += dot(p, p + 34.5);
return fract(p.x * p.y);
}
vec2 rot2(vec2 p, float a) {
float c = cos(a);
float s = sin(a);
return vec2(c * p.x - s * p.y, s * p.x + c * p.y);
}
// Rotating 3D sculptural still-life (ceramic amphora-torus + flanking fruit spheres)
vec2 mapStillLife(vec3 p, float t) {
vec3 rp = p;
rp.xz = rot2(rp.xz, t * 0.75);
float d1 = length(rp - vec3(-0.24, 0.02, 0.08)) - 0.34;
float d2 = length(rp - vec3(0.32, -0.10, -0.06)) - 0.25;
vec2 tq = vec2(length(rp.xz - vec2(0.06, -0.02)) - 0.26, rp.y - 0.20);
float d3 = length(tq) - 0.11;
vec2 res = vec2(d1, 1.0);
if (d2 < res.x) res = vec2(d2, 2.0);
if (d3 < res.x) res = vec2(d3, 3.0);
return res;
}
vec3 calcNormal(vec3 p, float t) {
vec2 e = vec2(0.0025, 0.0);
return normalize(vec3(
mapStillLife(p + e.xyy, t).x - mapStillLife(p - e.xyy, t).x,
mapStillLife(p + e.yxy, t).x - mapStillLife(p - e.yxy, t).x,
mapStillLife(p + e.yyx, t).x - mapStillLife(p - e.yyx, t).x
));
}
// Evaluate a single painterly oil-brush dab lattice in coordinate space q (2D screen vs 3D surface UV!)
vec3 evalBrushField(vec2 q, vec3 baseLit, float dens, float strokeLen) {
vec2 g = q * dens;
vec2 cell = floor(g);
vec2 f = fract(g);
vec3 bestCol = baseLit;
float bestD = 9.0;
float bristle = 0.0;
for (int j = -1; j <= 1; j++) {
for (int i = -1; i <= 1; i++) {
vec2 nb = cell + vec2(float(i), float(j));
vec2 jit = vec2(hash21(nb + 1.3), hash21(nb + 19.7));
float ang = (hash21(nb + 41.1) - 0.5) * 1.15 + 0.45;
vec2 d = (nb + jit) - g;
vec2 dl = rot2(d, ang);
// Elongated bristle stroke footprint
vec2 scaled = dl * vec2(1.0 / max(strokeLen, 0.25), 2.3);
float dist = length(scaled);
if (dist < bestD) {
bestD = dist;
float hueShift = (hash21(nb + 73.9) - 0.5) * 0.22;
float valShift = (hash21(nb + 97.1) - 0.5) * 0.16;
vec3 dabCol = baseLit * (1.0 + valShift) + vec3(hueShift, -hueShift * 0.4, hueShift * 0.6) * 0.35;
bristle = 0.85 + 0.22 * sin(dl.y * 28.0 + hash21(nb + 11.7) * 6.28);
bestCol = dabCol * bristle;
}
}
}
float dabEdge = smoothstep(0.68, 0.46, bestD);
return mix(baseLit * 0.78, bestCol, dabEdge);
}
vec3 aces(vec3 x) {
x = max(x, 0.0);
return (x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14);
}
void mainImage(out vec4 fragColor, in vec2 fragCoord) {
vec2 uv = (fragCoord - 0.5 * iResolution.xy) / iResolution.y;
float screenX = fragCoord.x / max(iResolution.x, 1.0);
float split = clamp(P_SPLIT, 0.0, 1.0);
float dens = clamp(P_STROKE_DENS, 4.0, 16.0);
float bLen = clamp(P_BRUSH_LEN, 0.25, 1.6);
float t = iTime * max(P_ROT_SPEED, 0.0);
// Warm Impressionist painted canvas backdrop
vec3 bgBase = mix(vec3(0.24, 0.34, 0.46), vec3(0.76, 0.68, 0.52), smoothstep(-0.45, 0.50, uv.y));
vec3 col = evalBrushField(uv, bgBase, dens * 0.9, bLen);
vec3 ro = vec3(0.0, 0.20, 2.08);
vec3 rd = normalize(vec3(uv.x, uv.y - 0.04, -1.48));
vec3 lDir = normalize(vec3(0.62, 0.74, 0.52));
float dist = 0.05;
vec2 hit = vec2(10.0, 0.0);
for (int i = 0; i < 64; i++) {
vec2 h = mapStillLife(ro + rd * dist, t);
if (h.x < 0.002) { hit = vec2(dist, h.y); break; }
dist += h.x;
if (dist > 6.5) break;
}
if (hit.y > 0.5) {
vec3 p = ro + rd * hit.x;
vec3 n = calcNormal(p, t);
float ndl = max(dot(n, lDir), 0.0);
float rim = pow(1.0 - max(dot(n, -rd), 0.0), 3.0);
vec3 alb = (hit.y < 1.5) ? vec3(0.92, 0.42, 0.22)
: ((hit.y < 2.5) ? vec3(0.22, 0.64, 0.54) : vec3(0.95, 0.78, 0.26));
vec3 lit = alb * (vec3(0.24, 0.28, 0.42) + vec3(1.18, 1.08, 0.92) * ndl) + vec3(0.96, 0.88, 0.66) * rim * 0.45;
if (screenX < split) {
// Left: Naive 2D screen-space painterly strokes -> static "shower-door" glass swimming over moving 3D form!
col = evalBrushField(uv * 1.15, lit, dens * 1.45, bLen);
} else {
// Right: Meier 1996 3D object-space surface-anchored brush particles -> strokes ride coherently with 3D rotation!
vec3 pObj = p;
pObj.xz = rot2(pObj.xz, t * 0.75);
// Spherical/cylindrical triplanar surface parameterization rigidly locked to the rotating 3D geometry
vec2 surfUv = vec2(atan(pObj.z, pObj.x) * 0.42, pObj.y * 1.15 + 0.15 * sin(pObj.x * 3.0));
col = evalBrushField(surfUv, lit, dens * 1.35, bLen);
}
}
float sep = smoothstep(0.0035, 0.0008, abs(screenX - split));
col = mix(col, vec3(0.96, 0.95, 0.90), sep);
fragColor = vec4(pow(clamp(aces(col), 0.0, 1.0), vec3(1.0 / 2.2)), 1.0);
}Attribution: MIT — written for this index.
Measured GPU weight & timing
| Preset | GPU | Weight / p50 / p95 | Method |
|---|---|---|---|
| painterly-animation-meier-live | Tesla T4 1920x1080 | 25.1× baseline (heavy) · 0.825 ms / 0.833 ms | opengl-timer-query · 32 frames · GPU Weight Atlas · Colab T4 sweep |
| painterly-animation-meier-live | NVIDIA L4 1920x1080 | 22.2× baseline (heavy) · 0.352 ms / 0.360 ms · 2.3× faster on L4 | opengl-timer-query · Cross-architecture validation |
| painterly-animation-meier-live | NVIDIA A100-SXM4-40GB 1920x1080 | 18.9× baseline (moderate) · 0.544 ms / 0.552 ms · 1.5× faster on A100 | opengl-timer-query · Cross-architecture validation |
Lineage
From the citation graph (Crossref reference lists): cited by Procedural cross-hatching shader, Real-time hatching with tonal art maps, Interactive watercolor rendering with temporal coherence.
Crosses
- Brush strokes that flock: A painterly renderer whose strokes swarm, drift and settle like a murmuration while still describing the 3D form. Each stroke particle is a boid tethered to its surface anchor, so one slider moves the look from still painting to living paint.
- Splats as world-anchored brush strokes: A captured place repainted with strokes that hold still as the camera moves. Each Gaussian already is what painterly animation needs: a surface-anchored particle with colour, orientation and size, so stroke direction comes from geometry, not image gradients.
- Gaussian splats drawn as brush marks: Same principle: strokes attached to a 3D representation; here they are Gaussian splats.
Sources
- primaryBarbara J. Meier (1996). Painterly rendering for animation. Proceedings of the 23rd annual conference on Computer graphics and interactive techniques.Verified via crossref · 2026-11-29doi:10.1145/237170.237288