---
id: "painterly-animation-meier"
title: "Painterly rendering for animation (Meier)"
domain: "npr"
stage: "material"
realtime: "interactive"
platforms: [cpu, desktop-gpu]
year_introduced: 1996
inputs: [mesh, particles, ldr-image]
outputs: [ldr-image]
style: "stylized"
dynamic: "dynamic"
cost: "medium"
authority: "Meier, 1996"
url: "https://texelatlas.vercel.app/t/painterly-animation-meier/"
sources_verified_at: "2026-11-29"
---
# Painterly rendering for animation (Meier) (Meier, 1996)

> 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.

## 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

## 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 use it

Choose it for painterly 3D animation where frame-to-frame coherence is essential. Prefer [Painterly rendering with curved brush strokes](https://texelatlas.vercel.app/t/painterly-curved-brush-strokes.md) for rendering strokes from a single image with curved paths, and [Anisotropic Kuwahara filter](https://texelatlas.vercel.app/t/anisotropic-kuwahara.md) for a cheap screen-space look at the cost of swimming.

## Cost

medium — Scales with particle count; interactive on 1990s hardware, easily real-time on a GPU with instancing.
Measured GPU Weight: 25.09× baseline (heavy) — 0.8253 ms median / 0.8329 ms p95 on Tesla T4/PCIe/SSE2 @ 1920x1080 (opengl-timer-query).
Ada L4 scaling: 22.16× baseline (heavy) — 0.3523 ms median (2.34× faster on L4).
Ampere A100 scaling: 18.88× baseline (moderate) — 0.5437 ms median (1.52× faster on A100).

## Failure modes

- 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

## Dataflow

- Inputs: mesh, particles, ldr-image
- Outputs: ldr-image
- Platforms: cpu, desktop-gpu

## Presets

### Painterly Animation (Meier 1996) — 2D screen-space shower-door swimming (left) vs 3D surface-anchored brush particles (right) (glsl-fragment; rendered 2026-11-30)

```json
{
  "P_STROKE_DENS": 9,
  "P_BRUSH_LEN": 0.75,
  "P_ROT_SPEED": 0.55,
  "P_SPLIT": 0.48
}
```

```glsl
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.

## Lineage

- extends [Stroke-based rendering](https://texelatlas.vercel.app/t/stroke-based-rendering.md)

## Combines with

- [Gaussian splats drawn as brush marks](https://texelatlas.vercel.app/t/sillage-brush-splatting.md): Same principle: strokes attached to a 3D representation; here they are Gaussian splats.

## Combination ideas

- [Brush strokes that flock](https://texelatlas.vercel.app/ideas/flocking-brush-strokes/)
- [Splats as world-anchored brush strokes](https://texelatlas.vercel.app/ideas/splats-as-brush-strokes/)

## Sources

1. [primary] Barbara J. Meier (1996) Painterly rendering for animation. Proceedings of the 23rd annual conference on Computer graphics and interactive techniques. https://doi.org/10.1145/237170.237288 (verified via crossref on 2026-11-29)

## Cite this entry

Texel. "Painterly rendering for animation (Meier)." https://texelatlas.vercel.app/t/painterly-animation-meier/ (accessed 2026-12-01).
