---
id: "chaotic-attractor-density-rendering"
title: "Chaotic attractor density rendering"
aliases: [Lorenz attractor, strange attractor rendering]
domain: "simulation"
stage: "simulation"
realtime: "realtime"
platforms: [webgl2, webgpu, desktop-gpu, cpu]
year_introduced: 1963
inputs: [particles]
outputs: [ldr-image, volume-density]
style: "stylized"
dynamic: "dynamic"
cost: "medium"
authority: "Lorenz, 1963"
url: "https://texelatlas.vercel.app/t/chaotic-attractor-density-rendering/"
sources_verified_at: "2026-11-29"
---
# Chaotic attractor density rendering (Lorenz, 1963)

> Visualises Lorenz-style strange attractors by integrating many trajectories and accumulating them into a density image or fibre set, tone-mapped for glow.

## Reach for it when

- 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

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

Choose it for scientific/artistic visualisation of chaotic systems and procedural backgrounds. Prefer [Boids flocking](https://texelatlas.vercel.app/t/boids.md) for agent flocks, [Physarum agent transport networks](https://texelatlas.vercel.app/t/physarum-transport-networks.md) for network textures, and [Gray-Scott reaction-diffusion](https://texelatlas.vercel.app/t/gray-scott-reaction-diffusion.md) for PDE-based patterns; use volume density rendering when you need 3D depth cues.

## Cost

medium — Cost is points x splat size; compute-shader accumulation is cheap, per-pixel loops are heavy.
Measured GPU Weight: 781.29× baseline (extreme) — 25.7044 ms median / 26.1186 ms p95 on Tesla T4/PCIe/SSE2 @ 1920x1080 (opengl-timer-query).
Ada L4 scaling: 577.92× baseline (extreme) — 9.1889 ms median (2.8× faster on L4).
Ampere A100 scaling: 546.2× baseline (extreme) — 15.7307 ms median (1.63× faster on A100).

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

## Dataflow

- Inputs: particles
- Outputs: ldr-image, volume-density
- Platforms: webgl2, webgpu, desktop-gpu, cpu

## Presets

### Lorenz attractor density splat (glsl-fragment; rendered 2026-11-29)

```json
{
  "STEPS": 1400,
  "DT": 0.0105,
  "SIGMA": 10,
  "RHO": 28,
  "BETA": 2.6667
}
```

```glsl
// GLSL ES 3.0 - Lorenz attractor density splat; written for this index
const int STEPS = 1400;       // trajectory samples
const float DT = 0.0105;      // integration step
const float SIGMA = 10.0;
const float RHO = 28.0;
const float BETA = 8.0 / 3.0;
const float SPLAT = 0.0009;   // splat variance in view space
const float GAIN = 0.045;

vec3 lorenz(vec3 p) {
  return vec3(SIGMA * (p.y - p.x), p.x * (RHO - p.z) - p.y, p.x * p.y - BETA * p.z);
}

void mainImage(out vec4 fragColor, in vec2 fragCoord) {
  vec2 uv = (fragCoord - 0.5 * iResolution.xy) / iResolution.y;
  float ang = 0.4 * iTime;
  float c = cos(ang), s = sin(ang);
  vec3 p = vec3(1.0, 1.0, 1.0);
  for (int i = 0; i < 200; i++) {
    vec3 k1 = lorenz(p);
    vec3 k2 = lorenz(p + 0.5 * DT * k1);
    p += DT * k2;
  }
  float dens = 0.0;
  float hue = 0.0;
  for (int i = 0; i < STEPS; i++) {
    vec3 k1 = lorenz(p);
    vec3 k2 = lorenz(p + 0.5 * DT * k1);
    p += DT * k2;
    vec3 q = p - vec3(0.0, 0.0, 25.0);
    vec2 v = vec2(c * q.x - s * q.y, q.z) * 0.032;
    vec2 d = uv - v;
    float w = exp(-dot(d, d) / SPLAT);
    dens += w;
    hue += w * float(i) / float(STEPS);
  }
  float l = 1.0 - exp(-GAIN * dens * 4.0);
  float h = hue / max(dens, 1e-4);
  vec3 col = mix(vec3(0.1, 0.35, 0.9), vec3(1.0, 0.55, 0.2), h);
  col = col * l + vec3(0.01, 0.015, 0.03);
  fragColor = vec4(col, 1.0);
}

```

Attribution: written for this index

## Combination ideas

- [Strange attractors as lit clouds](https://texelatlas.vercel.app/ideas/attractor-clouds-delta-tracked/)

## Sources

1. [primary] Edward N. Lorenz (1963) Deterministic Nonperiodic Flow. Journal of the Atmospheric Sciences. https://doi.org/10.1175/1520-0469(1963)020<0130:dnf>2.0.co;2 (verified via crossref on 2026-11-29)
2. [tutorial] Paul Bourke Lorenz Attractor. paulbourke.net. https://paulbourke.net/fractals/lorenz (verified via http on 2026-11-29)

## Cite this entry

Texel. "Chaotic attractor density rendering." https://texelatlas.vercel.app/t/chaotic-attractor-density-rendering/ (accessed 2026-12-01).
