{
 "id": "watercolor-bousseau-realtime",
 "title": "Interactive watercolor rendering with temporal coherence",
 "aliases": [],
 "domain": "npr",
 "subdomain": "watercolor",
 "stage": "post",
 "realtime": "realtime",
 "platforms": [
  "webgl2",
  "webgpu",
  "desktop-gpu",
  "mobile-gpu",
  "cpu"
 ],
 "year_introduced": 2006,
 "inputs": [
  "ldr-image",
  "depth",
  "normals"
 ],
 "outputs": [
  "ldr-image"
 ],
 "style": "stylized",
 "dynamic": "dynamic",
 "summary": "A real-time pipeline that turns rendered 3D animation into watercolour imagery (abstraction, edge darkening, pigment variation, paper) while limiting flicker and swimming.",
 "how_it_works": "The method stacks several post-processing steps on a rendered frame: colour simplification via smoothing of the rendered image, a pigment-dispersion effect through procedural noise perturbation, edge darkening where gradient magnitude is large, and a paper texture layered via a multiply. The key concern is temporal coherence: effects like pigment noise and paper must not swim or flicker as the camera or objects move, so they are handled with scene-aware coherence rather than being re-generated each frame. Abstraction and pigment parameters are controlled per object with masks, which lets artists pick which parts remain detailed.",
 "when_to_use": "Choose it for a watercolour look on animated 3D scenes with controllable abstraction per object. Prefer `watercolor-rendering-curtis` for physically simulated paint on 2D canvases, and `kuwahara-filter` or `anisotropic-kuwahara` for a cheap generic painterly look with no paper-texture coherence.",
 "cost": {
  "class": "medium",
  "notes": "Several full-screen passes; interactive to real-time on a modern GPU."
 },
 "failure_modes": [
  "Image-space smoothing blurs fine details such as faces",
  "Coherence can fail at occlusions and fast motion",
  "Paper texture can show a shower-door effect if it is tied only to the screen",
  "Edge darkening halos on noisy renders"
 ],
 "sources": [
  {
   "role": "primary",
   "key": "doi:10.1145/1124728.1124751",
   "type": "paper",
   "title": "Interactive watercolor rendering with temporal coherence and abstraction",
   "authors": [
    "Adrien Bousseau",
    "Matt Kaplan",
    "Joëlle Thollot",
    "François X. Sillion"
   ],
   "year": 2006,
   "venue": "Proceedings of the 4th international symposium on Non-photorealistic animation and rendering",
   "url": "https://doi.org/10.1145/1124728.1124751",
   "ids": {
    "doi": "10.1145/1124728.1124751"
   },
   "license": null,
   "extra": {
    "csl_type": "proceedings-article"
   },
   "provenance": {
    "title": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/1124728.1124751",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/1124728.1124751",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/1124728.1124751",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/1124728.1124751",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/1124728.1124751",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": 1,
   "__bib": "bousseau2006interactive"
  }
 ],
 "presets": [
  {
   "id": "watercolor-bousseau-realtime-live",
   "title": "Interactive Watercolor (Bousseau et al.) — dry 3D shaded render (left) vs abstraction, capillary edge darkening, granulation & paper grain (right)",
   "runtime": "glsl-fragment",
   "params": {
    "P_EDGE_DARK": 0.8,
    "P_GRANULATION": 0.65,
    "P_PAPER_GRAIN": 0.7,
    "P_SPLIT": 0.44
   },
   "basis": "original",
   "license_note": "MIT — written for this index.",
   "code": "const float P_EDGE_DARK = 0.80; // P Capillary Edge Dark [0.0, 1.3, 0.05]\nconst float P_GRANULATION = 0.65; // P Pigment Granulation [0.0, 1.2, 0.05]\nconst float P_PAPER_GRAIN = 0.70; // P Cold-Press Paper [0.0, 1.0, 0.05]\nconst float P_SPLIT = 0.44; // P Dry 3D / Watercolor [0.0, 1.0, 0.02]\n\nfloat hash21(vec2 p) {\n  p = fract(p * vec2(127.1, 311.7));\n  p += dot(p, p + 34.5);\n  return fract(p.x * p.y);\n}\n\nfloat vnoise(vec2 p) {\n  vec2 i = floor(p);\n  vec2 f = fract(p);\n  vec2 u = f * f * (3.0 - 2.0 * f);\n  return mix(\n    mix(hash21(i), hash21(i + vec2(1.0, 0.0)), u.x),\n    mix(hash21(i + vec2(0.0, 1.0)), hash21(i + vec2(1.0, 1.0)), u.x),\n    u.y\n  );\n}\n\nfloat fbm(vec2 p) {\n  float a = 0.5;\n  float s = 0.0;\n  for (int i = 0; i < 4; i++) {\n    s += a * vnoise(p);\n    p = p * 2.03 + vec2(13.7, 29.1);\n    a *= 0.5;\n  }\n  return s;\n}\n\nfloat sdBox(vec3 p, vec3 b) {\n  vec3 q = abs(p) - b;\n  return length(max(q, 0.0)) + min(max(q.x, max(q.y, q.z)), 0.0);\n}\n\n// Sunlit Mediterranean stone archway, cypress spheres & reflective canal (classic Bousseau watercolor subject)\nvec2 mapBridge(vec3 p) {\n  float dWater = p.y + 0.52;\n  vec2 res = vec2(dWater, 1.0);\n\n  // Stone bridge arch spanning across canal\n  float dWall = sdBox(p - vec3(0.0, -0.10, -0.35), vec3(1.15, 0.44, 0.26));\n  float dArchHole = length(vec2(p.x, p.y + 0.48)) - 0.42;\n  float dBridge = max(dWall, -dArchHole);\n  if (dBridge < res.x) res = vec2(dBridge, 2.0);\n\n  // Terracotta villa dome behind bridge\n  float dDome = length(p - vec3(0.46, 0.24, -0.78)) - 0.34;\n  if (dDome < res.x) res = vec2(dDome, 3.0);\n\n  // Sunlit foliage spheres on left bank\n  float dTree1 = length(p - vec3(-0.62, 0.22, -0.58)) - 0.32;\n  float dTree2 = length(p - vec3(-0.34, 0.16, -0.70)) - 0.24;\n  float dTree = min(dTree1, dTree2);\n  if (dTree < res.x) res = vec2(dTree, 4.0);\n  return res;\n}\n\nvec3 calcNormal(vec3 p) {\n  vec2 e = vec2(0.003, 0.0);\n  return normalize(vec3(\n    mapBridge(p + e.xyy).x - mapBridge(p - e.xyy).x,\n    mapBridge(p + e.yxy).x - mapBridge(p - e.yxy).x,\n    mapBridge(p + e.yyx).x - mapBridge(p - e.yyx).x\n  ));\n}\n\n// Render dry scene color + object-space anchor coordinates (prevents shower-door swimming during camera motion!)\nvoid evalDryScene(vec2 uv, float t, out vec3 col, out float dep, out vec2 objAnchor) {\n  vec3 ro = vec3(0.22 * sin(t * 0.42), 0.14, 2.15);\n  vec3 rd = normalize(vec3(uv.x, uv.y - 0.04, -1.48));\n  vec3 sunDir = normalize(vec3(0.62, 0.72, 0.46));\n\n  col = mix(vec3(0.95, 0.89, 0.78), vec3(0.44, 0.68, 0.90), smoothstep(-0.08, 0.52, rd.y));\n  dep = 10.0;\n  objAnchor = uv * 4.5 + vec2(0.22 * sin(t * 0.42) * 0.5, 0.0);\n\n  float dist = 0.05;\n  vec2 hit = vec2(10.0, 0.0);\n  for (int i = 0; i < 60; i++) {\n    vec2 h = mapBridge(ro + rd * dist);\n    if (h.x < 0.0025) { hit = vec2(dist, h.y); break; }\n    dist += h.x;\n    if (dist > 8.5) break;\n  }\n\n  if (hit.y > 0.5) {\n    dep = hit.x;\n    vec3 p = ro + rd * hit.x;\n    vec3 n = calcNormal(p);\n    objAnchor = (hit.y < 1.5) ? (p.xz * 2.4) : (p.xy * 2.8 + p.z * 0.9);\n    float ndl = max(dot(n, sunDir), 0.0);\n\n    if (hit.y < 1.5) {\n      // Shimmering turquoise canal water\n      vec3 wAlb = mix(vec3(0.20, 0.54, 0.68), vec3(0.54, 0.78, 0.84), 0.5 + 0.5 * sin(p.z * 7.0 + p.x * 3.0));\n      float archSh = smoothstep(0.18, 0.55, abs(p.z + 0.35));\n      col = wAlb * (0.45 + 0.55 * archSh);\n    } else if (hit.y < 2.5) {\n      // Warm sandstone bridge\n      vec3 sAlb = vec3(0.88, 0.78, 0.62);\n      col = sAlb * (0.32 + 0.82 * ndl) + vec3(0.18, 0.28, 0.44) * (1.0 - ndl) * 0.30;\n    } else if (hit.y < 3.5) {\n      // Terracotta roof dome\n      col = vec3(0.90, 0.44, 0.28) * (0.30 + 0.85 * ndl) + vec3(0.20, 0.24, 0.42) * (1.0 - ndl) * 0.26;\n    } else {\n      // Olive-emerald foliage\n      col = vec3(0.26, 0.62, 0.36) * (0.30 + 0.85 * ndl) + vec3(0.14, 0.28, 0.38) * (1.0 - ndl) * 0.25;\n    }\n  }\n}\n\nvoid mainImage(out vec4 fragColor, in vec2 fragCoord) {\n  vec2 uv = (fragCoord - 0.5 * iResolution.xy) / iResolution.y;\n  float screenX = fragCoord.x / max(iResolution.x, 1.0);\n  float split = clamp(P_SPLIT, 0.0, 1.0);\n  float edgeDark = clamp(P_EDGE_DARK, 0.0, 1.4);\n  float granAmt = clamp(P_GRANULATION, 0.0, 1.4);\n  float paperAmt = clamp(P_PAPER_GRAIN, 0.0, 1.0);\n\n  vec3 dryCol;\n  float cDep;\n  vec2 objAnchor;\n  evalDryScene(uv, iTime, dryCol, cDep, objAnchor);\n  vec3 col = dryCol;\n\n  if (screenX >= split) {\n    // Right: Bousseau real-time watercolor pipeline (wobble -> abstraction -> pigment granulation -> edge darkening -> paper!)\n    // 1. Object-anchored pigment wobble (temporally coherent as camera glides!)\n    vec2 wob = (vec2(fbm(objAnchor * 1.4), fbm(objAnchor * 1.4 + vec2(7.3, 19.1))) - 0.5) * 0.016 * granAmt;\n    vec2 wUv = uv + wob;\n\n    // 2. Color simplification / wet-on-wet 5-tap abstraction smoothing\n    vec3 c0, cL, cR, cD, cU;\n    float d0, dL, dR, dD, dU;\n    vec2 a0, aTmp;\n    float eps = 0.008;\n    evalDryScene(wUv, iTime, c0, d0, a0);\n    evalDryScene(wUv + vec2(-eps, 0.0), iTime, cL, dL, aTmp);\n    evalDryScene(wUv + vec2(eps, 0.0), iTime, cR, dR, aTmp);\n    evalDryScene(wUv + vec2(0.0, -eps), iTime, cD, dD, aTmp);\n    evalDryScene(wUv + vec2(0.0, eps), iTime, cU, dU, aTmp);\n\n    vec3 wash = (c0 * 2.0 + cL + cR + cD + cU) / 6.0;\n    // Slight vibrant watercolor glaze lift (translucent bright paper showing through pigment)\n    wash = mix(wash, pow(clamp(wash, 0.0, 1.0), vec3(0.88)), 0.35);\n\n    // 3. Pigment dispersion / granulation using temporally coherent object-space fBM\n    float gran = fbm(a0 * 2.6 + vec2(3.1, 8.7));\n    float granMod = 1.0 + (gran - 0.5) * 0.42 * granAmt;\n    // Kubelka-Munk-like pigment concentration power curve (pigment pools saturate & darken!)\n    vec3 pigmented = pow(clamp(wash, 0.02, 1.0), vec3(granMod));\n\n    // 4. Capillary edge darkening (wet pigment migrates to stroke boundaries where color/depth gradient spikes!)\n    float gradCol = length(cR - cL) + length(cU - cD);\n    float gradDep = (abs(dR - dL) + abs(dU - dD)) * 0.14;\n    float edgeMask = smoothstep(0.06, 0.34, gradCol + gradDep);\n    // Darken & slightly saturate boundary edges like dried watercolor backruns\n    vec3 edgePigment = pow(clamp(pigmented, 0.02, 1.0), vec3(1.0 + 1.35 * edgeDark * edgeMask));\n    edgePigment *= (1.0 - 0.28 * edgeDark * edgeMask);\n\n    // 5. Cold-press cotton watercolor paper texture (multiplied in screen space)\n    float paperFine = fbm(fragCoord * 0.16);\n    float paperCoarse = fbm(fragCoord * 0.045 + vec2(17.1, 4.3));\n    float paperH = mix(paperCoarse, paperFine, 0.55);\n    vec3 paperTint = vec3(0.99, 0.97, 0.93) * (0.88 + 0.18 * paperH);\n    // Granulation settles extra pigment into paper valleys\n    col = edgePigment * mix(vec3(1.0), paperTint, paperAmt);\n    col = mix(col, col * (0.86 + 0.24 * paperH), paperAmt * 0.55);\n  }\n\n  float sep = smoothstep(0.0035, 0.0008, abs(screenX - split));\n  col = mix(col, vec3(0.22, 0.24, 0.30), sep);\n  fragColor = vec4(pow(clamp(col, 0.0, 1.0), vec3(1.0 / 2.2)), 1.0);\n}",
   "execution_fidelity": "conceptual-diagram",
   "proof": {
    "kind": "rendered",
    "label": "rendered 2026-11-30",
    "ok": true,
    "proof": {
     "ok": true,
     "technique": "watercolor-bousseau-realtime",
     "runtime": "glsl-fragment",
     "checked_at": "2026-11-30T21:07:29.000Z",
     "renderer": "Headless EGL Tesla T4/PCIe/SSE2, OpenGL 3.30 Core, 512×512, iTime=1.5",
     "stats": {
      "mean": 0.7765,
      "std": 0.1092,
      "min": 0.2375,
      "max": 0.9509
     },
     "image": "/specimens/watercolor-bousseau-realtime-live.webp",
     "reason": null
    }
   }
  }
 ],
 "related": [
  "watercolor-rendering-curtis",
  "anisotropic-kuwahara",
  "painterly-animation-meier"
 ],
 "extends": [
  "watercolor-rendering-curtis"
 ],
 "supersedes": [],
 "combines_with": [
  {
   "id": "anisotropic-kuwahara",
   "why": "Kuwahara abstraction provides the colour flattening before paper and edge-darkening layers."
  }
 ],
 "provenance": {
  "prose": "original text written for this index (research draft, editorially reviewed)",
  "sources_verified_at": "2026-11-29T15:51:27.588Z",
  "draft": "data/drafts/npr/watercolor-bousseau-realtime.json"
 },
 "solves": [
  "want a watercolour look on animated 3d scenes",
  "paint effect flickers or swims across frames",
  "pigment, paper and edge darkening in real time",
  "per-object control of abstraction in stylised render",
  "watercolour stylisation for interactive 3d"
 ],
 "authority": "Bousseau et al., 2006",
 "url": "https://texelatlas.vercel.app/t/watercolor-bousseau-realtime/",
 "execution_fidelity": "conceptual-diagram",
 "fidelity_label": "Visual Diagram",
 "benchmark_eligible": false,
 "gpu_weight": {
  "weight_x": 87.2,
  "tier": "extreme",
  "p50_ms": 2.8689,
  "p95_ms": 3.0414,
  "baseline_p50_ms": 0.0329,
  "gpu": "Tesla T4/PCIe/SSE2",
  "resolution": "1920x1080",
  "method": "opengl-timer-query",
  "frames": 32,
  "preset_id": "watercolor-bousseau-realtime-live",
  "execution_fidelity": "conceptual-diagram",
  "fidelity_label": "Visual Diagram",
  "benchmark_eligible": false,
  "generated_at": "2026-11-30T21:07:47Z",
  "l4": {
   "weight_x": 78.35,
   "tier": "extreme",
   "p50_ms": 1.2457,
   "p95_ms": 1.2677,
   "speedup_x": 2.3,
   "gpu": "NVIDIA L4/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0159
  },
  "a100": {
   "weight_x": 57.09,
   "tier": "heavy",
   "p50_ms": 1.6443,
   "p95_ms": 1.6625,
   "speedup_x": 1.74,
   "gpu": "NVIDIA A100-SXM4-40GB/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0288
  }
 }
}