{
 "id": "curl-noise-flow",
 "title": "Curl noise for procedural fluid motion",
 "aliases": [
  "curl noise",
  "divergence-free noise",
  "pseudo-fluid flow"
 ],
 "domain": "simulation",
 "subdomain": "procedural flow",
 "stage": "simulation",
 "realtime": "realtime",
 "platforms": [
  "webgl2",
  "webgpu",
  "desktop-gpu",
  "cpu",
  "unity",
  "unreal",
  "godot",
  "houdini",
  "blender"
 ],
 "year_introduced": 2007,
 "inputs": [
  "particles"
 ],
 "outputs": [
  "particles",
  "volume-density"
 ],
 "style": "both",
 "dynamic": "dynamic",
 "summary": "Take the curl of a smooth noise potential to get a velocity field with zero divergence, so advected particles swirl like fluid without bunching up or draining away.",
 "how_it_works": "Pick a smooth scalar noise potential psi(x, y) in 2D, or a vector potential of three noise functions in 3D. The velocity is its curl: in 2D v = (dpsi/dy, -dpsi/dx), in 3D v = curl of the vector potential. Because the divergence of a curl is identically zero, the field is incompressible: advected points neither pile up nor spread out in a net way. Derivatives come analytically from gradient noise or by central differences of a few samples. Boundaries are handled by ramping the potential toward zero near an obstacle, or by blending with the distance-based gradient so the flow becomes tangent to the surface and goes around it. Animating the potential over time, or offsetting noise octaves, changes the flow and adds turbulence at several scales. The result is evaluated per particle each step with no neighbour search, and a few octaves already read as smoke or ink in water.",
 "when_to_use": "Choose it for cheap, art-directable turbulence for smoke, dust, embers, magic and ambient flow where real fluid dynamics is unnecessary. Prefer `stable-fluids`, `flip-pic-fluids` or `lattice-boltzmann-fluids` when the flow must respond to moving objects, buoyancy or vorticity from real physics. Prefer `domain-warping` for static texture patterns, and plain `perlin-noise` or `simplex-noise` offsets when divergence does not matter. Use it as the force input to `gpu-particle-systems` and as a wind source for `foliage-wind-animation`.",
 "cost": {
  "class": "cheap",
  "notes": "Four to six noise samples per particle per step in 2D, more in 3D; multiple octaves multiply it."
 },
 "failure_modes": [
  "No true dynamics: flow ignores obstacles and sources unless the potential is explicitly modified near them",
  "Boundary ramping produces visible stagnation or ring artefacts around colliders",
  "Low-frequency potentials give long coherent loops that look mechanical",
  "Finite-difference step too large or too small causes visible blockiness or noise in the derivative",
  "Streams in 3D can spiral into tubes and closed orbits, so particles keep circling instead of dispersing"
 ],
 "sources": [
  {
   "role": "primary",
   "key": "doi:10.1145/1275808.1276435",
   "type": "paper",
   "title": "Curl-noise for procedural fluid flow",
   "authors": [
    "Robert Bridson",
    "Jim Houriham",
    "Marcus Nordenstam"
   ],
   "year": 2007,
   "venue": "ACM SIGGRAPH 2007 papers",
   "url": "https://doi.org/10.1145/1275808.1276435",
   "ids": {
    "doi": "10.1145/1275808.1276435"
   },
   "license": null,
   "extra": {
    "csl_type": "proceedings-article"
   },
   "provenance": {
    "title": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/1275808.1276435",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/1275808.1276435",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/1275808.1276435",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/1275808.1276435",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/1275808.1276435",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": 1,
   "__bib": "bridson2007curl"
  }
 ],
 "presets": [
  {
   "id": "curl-noise-lic-field",
   "title": "Curl-noise flow visualised with line integral convolution",
   "runtime": "glsl-fragment",
   "params": {
    "freq": 2.5,
    "steps": 18,
    "step_len": 0.006,
    "grain_density": 110,
    "drift": 0.15
   },
   "code": "// GLSL ES 3.0, Shadertoy-style. Curl of a scalar noise potential, drawn as line-integral-convolution streaks.\nconst float FREQ    = 2.5;     // spatial frequency of the potential\nconst int   STEPS   = 18;      // integration steps each way\nconst float STEP    = 0.006;   // step length in uv units\nconst float DENSITY = 110.0;   // grain resolution of the smeared noise\nconst float DRIFT   = 0.15;    // potential animation speed\n\nfloat hash21(vec2 p) {\n    vec3 p3 = fract(vec3(p.xyx) * 0.1031);\n    p3 += dot(p3, p3.yzx + 33.33);\n    return fract((p3.x + p3.y) * p3.z);\n}\nfloat vnoise(vec2 p) {\n    vec2 i = floor(p), f = fract(p);\n    f = f * f * f * (f * (f * 6.0 - 15.0) + 10.0);\n    return mix(mix(hash21(i), hash21(i + vec2(1, 0)), f.x),\n               mix(hash21(i + vec2(0, 1)), hash21(i + vec2(1, 1)), f.x), f.y);\n}\nfloat potential(vec2 p) {\n    vec2 q = p * FREQ + vec2(iTime * DRIFT, 0.0);\n    return vnoise(q) + 0.5 * vnoise(q * 2.0 + 7.3);\n}\nvec2 curl(vec2 p) {                       // divergence-free by construction\n    const float e = 0.01;\n    float dx = potential(p + vec2(e, 0)) - potential(p - vec2(e, 0));\n    float dy = potential(p + vec2(0, e)) - potential(p - vec2(0, e));\n    return vec2(dy, -dx) / (2.0 * e);\n}\n\nvoid mainImage(out vec4 fragColor, in vec2 fragCoord) {\n    vec2 uv = (fragCoord - 0.5 * iResolution.xy) / iResolution.y;\n    float sum = 0.0, wsum = 0.0;\n    for (int dir = 0; dir < 2; dir++) {\n        vec2 p = uv;\n        float s = dir == 0 ? 1.0 : -1.0;\n        for (int i = 0; i < STEPS; i++) {\n            vec2 v = curl(p);\n            p += s * STEP * v / (length(v) + 1e-4);\n            float w = 1.0 - float(i) / float(STEPS);\n            sum += w * hash21(floor(p * DENSITY));\n            wsum += w;\n        }\n    }\n    float g = sum / wsum;\n    vec2 v = curl(uv);\n    vec3 tint = 0.5 + 0.5 * cos(atan(v.y, v.x) + vec3(0.0, 2.1, 4.2));\n    fragColor = vec4(mix(vec3(g), tint * g * 1.6, 0.55), 1.0);\n}",
   "basis": "original",
   "license_note": "written for this index",
   "execution_fidelity": "conceptual-diagram",
   "proof": {
    "kind": "rendered",
    "label": "rendered 2026-11-29",
    "ok": true,
    "proof": {
     "ok": true,
     "technique": "curl-noise-flow",
     "runtime": "glsl-fragment",
     "checked_at": "2026-11-29T15:51:50.471Z",
     "renderer": "Chromium 145.0.7632.6 headless, WebGL2 via ANGLE/SwiftShader, 512×512, iTime=1.5",
     "stats": {
      "mean": 0.4251,
      "std": 0.1047,
      "unique_colors": 1250
     },
     "image": "/specimens/curl-noise-lic-field.webp",
     "reason": null
    }
   }
  }
 ],
 "related": [
  "stable-fluids",
  "domain-warping",
  "perlin-noise",
  "simplex-noise",
  "improved-perlin-noise",
  "gpu-particle-systems"
 ],
 "extends": [],
 "supersedes": [],
 "combines_with": [
  {
   "id": "gpu-particle-systems",
   "why": "Each particle samples the curl field as its velocity or acceleration, giving swirling motion without neighbour interaction."
  },
  {
   "id": "foliage-wind-animation",
   "why": "The curl field acts as a divergence-free wind source sampled at each vertex's world position."
  }
 ],
 "provenance": {
  "prose": "original text written for this index (research draft, editorially reviewed)",
  "sources_verified_at": "2026-11-29T15:51:27.588Z",
  "draft": "data/drafts/simulation/curl-noise-flow.json"
 },
 "solves": [
  "particles bunch up or drain away under plain noise motion",
  "want swirling smoke motion without running a fluid solver",
  "need divergence free turbulence for cheap pseudo fluid",
  "dust and embers should flow around in believable eddies"
 ],
 "authority": "Bridson et al., 2007",
 "url": "https://texelatlas.vercel.app/t/curl-noise-flow/",
 "execution_fidelity": "conceptual-diagram",
 "fidelity_label": "Visual Diagram",
 "benchmark_eligible": false,
 "gpu_weight": {
  "weight_x": 424.94,
  "tier": "extreme",
  "p50_ms": 13.9804,
  "p95_ms": 14.1352,
  "baseline_p50_ms": 0.0329,
  "gpu": "Tesla T4/PCIe/SSE2",
  "resolution": "1920x1080",
  "method": "opengl-timer-query",
  "frames": 20,
  "preset_id": "curl-noise-lic-field",
  "execution_fidelity": "conceptual-diagram",
  "fidelity_label": "Visual Diagram",
  "benchmark_eligible": false,
  "generated_at": "2026-11-30T21:07:47Z",
  "l4": {
   "weight_x": 358.88,
   "tier": "extreme",
   "p50_ms": 5.7062,
   "p95_ms": 5.8153,
   "speedup_x": 2.45,
   "gpu": "NVIDIA L4/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0159
  },
  "a100": {
   "weight_x": 300.16,
   "tier": "extreme",
   "p50_ms": 8.6446,
   "p95_ms": 8.6446,
   "speedup_x": 1.62,
   "gpu": "NVIDIA A100-SXM4-40GB/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0288
  }
 }
}