Chaotic attractor density rendering
Visualises Lorenz-style strange attractors by integrating many trajectories and accumulating them into a density image or fibre set, tone-mapped for glow.
Also known as Lorenz attractor, strange attractor rendering
In the family Simulation & animation, strange attractors
Where it runs
Built inOfficial add-onPluginNone foundNot researched
| Engine | Support | How |
|---|---|---|
| three.js r187 | None found | |
| Babylon.js 9.38.0 | None found | |
| Godot 4.7 | None found | No built-in chaotic attractor density/histogram renderer. |
| Unity | None found | |
| Unreal 5.7 | None found | No built-in chaotic attractor density renderer. |
| Blender 5.2 | None found | |
| WebGPU W3C | None found | |
| Metal | None found |
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 choose it
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
Choose it for scientific/artistic visualisation of chaotic systems and procedural backgrounds. Prefer Boids flocking for agent flocks, Physarum agent transport networks for network textures, and Gray-Scott reaction-diffusion for PDE-based patterns; use volume density rendering when you need 3D depth cues.
Field marks
- 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
Presets
Lorenz attractor density splat
{
"STEPS": 1400,
"DT": 0.0105,
"SIGMA": 10,
"RHO": 28,
"BETA": 2.6667
}Show GLSL (43 lines)
// 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
Measured GPU weight & timing
| Preset | GPU | Weight / p50 / p95 | Method |
|---|---|---|---|
| lorenz-density-splat | Tesla T4 1920x1080 | 781× baseline (extreme) · 25.7 ms / 26.1 ms | opengl-timer-query · 20 frames · GPU Weight Atlas · Colab T4 sweep |
| lorenz-density-splat | NVIDIA L4 1920x1080 | 578× baseline (extreme) · 9.19 ms / 9.26 ms · 2.8× faster on L4 | opengl-timer-query · Cross-architecture validation |
| lorenz-density-splat | NVIDIA A100-SXM4-40GB 1920x1080 | 546× baseline (extreme) · 15.7 ms / 15.7 ms · 1.6× faster on A100 | opengl-timer-query · Cross-architecture validation |
Crosses
- Strange attractors as lit clouds: Strange attractors rendered as physically lit participating media, with self-shadowing and multiple scattering, instead of glowing additive trails. Attractor density is extremely sparse, which suits null-collision tracking over a sparse grid.
Sources
- primaryEdward N. Lorenz (1963). Deterministic Nonperiodic Flow. Journal of the Atmospheric Sciences.Verified via crossref · 2026-11-29doi:10.1175/1520-0469(1963)020<0130:dnf>2.0.co;2