{
 "id": "chaotic-attractor-density-rendering",
 "title": "Chaotic attractor density rendering",
 "aliases": [
  "Lorenz attractor",
  "strange attractor rendering"
 ],
 "domain": "simulation",
 "subdomain": "strange attractors",
 "stage": "simulation",
 "realtime": "realtime",
 "platforms": [
  "webgl2",
  "webgpu",
  "desktop-gpu",
  "cpu"
 ],
 "year_introduced": 1963,
 "inputs": [
  "particles"
 ],
 "outputs": [
  "ldr-image",
  "volume-density"
 ],
 "style": "stylized",
 "dynamic": "dynamic",
 "summary": "Visualises Lorenz-style strange attractors by integrating many trajectories and accumulating them into a density image or fibre set, tone-mapped for glow.",
 "how_it_works": "Integrate an ODE system such as Lorenz (`dx=sigma(y-x)`, `dy=x(rho-z)-y`, `dz=xy-beta z`) with RK2 or RK4 from many starting points after a burn-in period so points lie on the attractor. Each sample is projected and splatted into a floating-point accumulation buffer (additive blending, or atomic adds in compute); the result is log or exponential tone-mapped and colourised by velocity, age or Lyapunov-style divergence. Alternatives draw the trajectory as tube or ribbon geometry, or accumulate in a 3D density texture for volume rendering. For buffer-free shaders the per-pixel loop integrates a trajectory and sums Gaussian splats, which is exact but costs O(steps) per pixel.",
 "when_to_use": "Choose it for scientific/artistic visualisation of chaotic systems and procedural backgrounds. Prefer `boids` for agent flocks, `physarum-transport-networks` for network textures, and `gray-scott-reaction-diffusion` for PDE-based patterns; use volume density rendering when you need 3D depth cues.",
 "cost": {
  "class": "medium",
  "notes": "Cost is points x splat size; compute-shader accumulation is cheap, per-pixel loops are heavy."
 },
 "failure_modes": [
  "Sparse sampling gives dotted trails rather than smooth densities",
  "Fixed-step Euler drifts off the attractor on stiff systems; use RK4 or small dt",
  "Float accumulation saturates: needs log tone-mapping or HDR buffers",
  "Different attractor families need re-tuned scale/offset to fit the viewport"
 ],
 "sources": [
  {
   "role": "primary",
   "key": "doi:10.1175/1520-0469(1963)020<0130:dnf>2.0.co;2",
   "type": "paper",
   "title": "Deterministic Nonperiodic Flow",
   "authors": [
    "Edward N. Lorenz"
   ],
   "year": 1963,
   "venue": "Journal of the Atmospheric Sciences",
   "url": "https://doi.org/10.1175/1520-0469(1963)020<0130:dnf>2.0.co;2",
   "ids": {
    "doi": "10.1175/1520-0469(1963)020<0130:dnf>2.0.co;2"
   },
   "license": null,
   "extra": {
    "csl_type": "journal-article"
   },
   "provenance": {
    "title": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1175/1520-0469(1963)020<0130:dnf>2.0.co;2",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1175/1520-0469(1963)020<0130:dnf>2.0.co;2",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1175/1520-0469(1963)020<0130:dnf>2.0.co;2",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1175/1520-0469(1963)020<0130:dnf>2.0.co;2",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1175/1520-0469(1963)020<0130:dnf>2.0.co;2",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": 1,
   "__bib": "lorenz1963deterministic"
  },
  {
   "role": "tutorial",
   "key": "url:https://paulbourke.net/fractals/lorenz",
   "type": "tutorial",
   "title": "Lorenz Attractor",
   "authors": [
    "Paul Bourke"
   ],
   "year": null,
   "venue": "paulbourke.net",
   "url": "https://paulbourke.net/fractals/lorenz",
   "ids": {},
   "license": null,
   "extra": {
    "http_status": 200,
    "live": true,
    "archive": {
     "url": "http://web.archive.org/web/20260918065006/https://paulbourke.net/fractals/lorenz/",
     "timestamp": "20260918065006"
    },
    "page_title": "The Lorenz Attractor, a thing of beauty",
    "host": "paulbourke.net",
    "title_confirmed_by_page": true,
    "title_unconfirmed": false
   },
   "provenance": {
    "title": {
     "authority": "http",
     "endpoint": "GET https://paulbourke.net/fractals/lorenz → 200",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "http",
     "endpoint": "GET https://paulbourke.net/fractals/lorenz → 200",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "research-draft",
     "endpoint": "title_hint/author_hint, checked against page title where available",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "http",
     "endpoint": "GET https://paulbourke.net/fractals/lorenz → 200",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "research-draft",
     "endpoint": "title_hint/author_hint, checked against page title where available",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": 0.95,
   "__bib": "bourkelorenz"
  }
 ],
 "presets": [
  {
   "id": "lorenz-density-splat",
   "title": "Lorenz attractor density splat",
   "runtime": "glsl-fragment",
   "params": {
    "STEPS": 1400,
    "DT": 0.0105,
    "SIGMA": 10,
    "RHO": 28,
    "BETA": 2.6667
   },
   "code": "// GLSL ES 3.0 - Lorenz attractor density splat; written for this index\nconst int STEPS = 1400;       // trajectory samples\nconst float DT = 0.0105;      // integration step\nconst float SIGMA = 10.0;\nconst float RHO = 28.0;\nconst float BETA = 8.0 / 3.0;\nconst float SPLAT = 0.0009;   // splat variance in view space\nconst float GAIN = 0.045;\n\nvec3 lorenz(vec3 p) {\n  return vec3(SIGMA * (p.y - p.x), p.x * (RHO - p.z) - p.y, p.x * p.y - BETA * p.z);\n}\n\nvoid mainImage(out vec4 fragColor, in vec2 fragCoord) {\n  vec2 uv = (fragCoord - 0.5 * iResolution.xy) / iResolution.y;\n  float ang = 0.4 * iTime;\n  float c = cos(ang), s = sin(ang);\n  vec3 p = vec3(1.0, 1.0, 1.0);\n  for (int i = 0; i < 200; i++) {\n    vec3 k1 = lorenz(p);\n    vec3 k2 = lorenz(p + 0.5 * DT * k1);\n    p += DT * k2;\n  }\n  float dens = 0.0;\n  float hue = 0.0;\n  for (int i = 0; i < STEPS; i++) {\n    vec3 k1 = lorenz(p);\n    vec3 k2 = lorenz(p + 0.5 * DT * k1);\n    p += DT * k2;\n    vec3 q = p - vec3(0.0, 0.0, 25.0);\n    vec2 v = vec2(c * q.x - s * q.y, q.z) * 0.032;\n    vec2 d = uv - v;\n    float w = exp(-dot(d, d) / SPLAT);\n    dens += w;\n    hue += w * float(i) / float(STEPS);\n  }\n  float l = 1.0 - exp(-GAIN * dens * 4.0);\n  float h = hue / max(dens, 1e-4);\n  vec3 col = mix(vec3(0.1, 0.35, 0.9), vec3(1.0, 0.55, 0.2), h);\n  col = col * l + vec3(0.01, 0.015, 0.03);\n  fragColor = vec4(col, 1.0);\n}\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": "chaotic-attractor-density-rendering",
     "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.0728,
      "std": 0.1332,
      "unique_colors": 239
     },
     "image": "/specimens/lorenz-density-splat.webp",
     "reason": null
    }
   }
  }
 ],
 "related": [
  "boids",
  "physarum-transport-networks",
  "gray-scott-reaction-diffusion"
 ],
 "extends": [],
 "supersedes": [],
 "combines_with": [],
 "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/chaotic-attractor-density-rendering.json"
 },
 "solves": [
  "want to visualise a lorenz-style chaotic system",
  "draw glowing swirling trajectories as a density image",
  "generate abstract scientific art from differential equations",
  "need a procedural backdrop of looping curves"
 ],
 "authority": "Lorenz, 1963",
 "url": "https://texelatlas.vercel.app/t/chaotic-attractor-density-rendering/",
 "execution_fidelity": "conceptual-diagram",
 "fidelity_label": "Visual Diagram",
 "benchmark_eligible": false,
 "gpu_weight": {
  "weight_x": 781.29,
  "tier": "extreme",
  "p50_ms": 25.7044,
  "p95_ms": 26.1186,
  "baseline_p50_ms": 0.0329,
  "gpu": "Tesla T4/PCIe/SSE2",
  "resolution": "1920x1080",
  "method": "opengl-timer-query",
  "frames": 20,
  "preset_id": "lorenz-density-splat",
  "execution_fidelity": "conceptual-diagram",
  "fidelity_label": "Visual Diagram",
  "benchmark_eligible": false,
  "generated_at": "2026-11-30T21:07:47Z",
  "l4": {
   "weight_x": 577.92,
   "tier": "extreme",
   "p50_ms": 9.1889,
   "p95_ms": 9.2642,
   "speedup_x": 2.8,
   "gpu": "NVIDIA L4/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0159
  },
  "a100": {
   "weight_x": 546.2,
   "tier": "extreme",
   "p50_ms": 15.7307,
   "p95_ms": 15.7317,
   "speedup_x": 1.63,
   "gpu": "NVIDIA A100-SXM4-40GB/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0288
  }
 }
}