228

Perlin Tendrils

Particles advecting through a multi-octave Fractal Brownian Motion (FBM) gradient field, forming delicate, branching filamentous structures.

Playground
60 FPS Canvas 2D
Click + Drag to interact with field
</>

Full Executable Algorithm Code

// 004 - Perlin Tendrils (organic)
// 1:1 Original algorithm engine source
function createPerlinTendrils() {
  const MAX_PARTICLES = 1500;
  const posX = new Float32Array(MAX_PARTICLES);
  const posY = new Float32Array(MAX_PARTICLES);
  const life = new Float32Array(MAX_PARTICLES);
  const maxLife = new Float32Array(MAX_PARTICLES);
  return {
    setup(context) {
      for (let i = 0; i < MAX_PARTICLES; i++) {
        posX[i] = Math.random() * context.width;
        posY[i] = Math.random() * context.height;
        life[i] = Math.random() * 200;
        maxLife[i] = 100 + Math.random() * 200;
      }
    },
    render(context, timeState, params) {
      const { ctx, width, height } = context;
      const count = Math.min(MAX_PARTICLES, Number(params.particleCount || 1e3));
      const speed = Number(params.speed || 1.5);
      const noiseScale = Number(params.noiseScale || 3e-3);
      const t = timeState.time * 0.15;
      ctx.fillStyle = "rgba(8, 9, 13, 0.08)";
      ctx.fillRect(0, 0, width, height);
      for (let i = 0; i < count; i++) {
        const angle = fbm2D(posX[i] * noiseScale, posY[i] * noiseScale + t) * Math.PI * 4;
        const prevX = posX[i];
        const prevY = posY[i];
        posX[i] += Math.cos(angle) * speed;
        posY[i] += Math.sin(angle) * speed;
        life[i]++;
        if (life[i] > maxLife[i] || posX[i] < 0 || posX[i] > width || posY[i] < 0 || posY[i] > height) {
          posX[i] = Math.random() * width;
          posY[i] = Math.random() * height;
          life[i] = 0;
          continue;
        }
        const progress = life[i] / maxLife[i];
        const alpha = Math.sin(progress * Math.PI) * 0.6;
        const hue = (160 + angle * 25 + timeState.time * 10) % 360;
        ctx.beginPath();
        ctx.moveTo(prevX, prevY);
        ctx.lineTo(posX[i], posY[i]);
        ctx.strokeStyle = hsla(hue, 80, 60, alpha);
        ctx.lineWidth = 1.2;
        ctx.stroke();
      }
    }
  };
}

// Default parameters from content metadata
const defaultParams = [
  {
    "key": "particleCount",
    "label": "Tendril Particles",
    "type": "range",
    "min": 200,
    "max": 1500,
    "step": 50,
    "defaultValue": 1000,
    "description": "Total tracer filaments"
  },
  {
    "key": "noiseScale",
    "label": "Noise Zoom Scale",
    "type": "range",
    "min": 0.001,
    "max": 0.008,
    "step": 0.0005,
    "defaultValue": 0.003,
    "description": "Curvature granularity"
  },
  {
    "key": "speed",
    "label": "Advection Speed",
    "type": "range",
    "min": 0.5,
    "max": 4,
    "step": 0.1,
    "defaultValue": 1.5,
    "description": "Velocity along vector lines"
  }
];

if (!window.__art_instances) window.__art_instances = {};
if (!window.__art_instances['perlin-tendrils']) {
  const inst = typeof createPerlinTendrils === 'function' ? createPerlinTendrils() : null;
  if (inst && inst.setup) {
    inst.setup({ ctx, width, height, dpr: 1, aspectRatio: width / height }, defaultParams);
  }
  window.__art_instances['perlin-tendrils'] = inst;
}

const instance = window.__art_instances['perlin-tendrils'];
if (instance && instance.render) {
  instance.render(
    { ctx, width, height, dpr: 1, aspectRatio: width / height },
    { time, deltaTime: dt, frameCount: Math.floor(time * 60), fps: 60 },
    defaultParams
  );
}
Edit in Interactive Playground Zero Dependencies • Standalone Canvas 2D
ƒ

Mathematical Formulation

medium
Analytical Equation
v(x,y,t)=×(i=0kγiNoise(2ix,2iy+ωt))\mathbf{v}(x, y, t) = \nabla \times \left( \sum_{i=0}^{k} \gamma^i \text{Noise}(2^i x, 2^i y + \omega t) \right)
Click to expand
Compact Formula
angle = fbm(x * 0.003, y * 0.003 + t * 0.15) * 4π, v = [cos(angle), sin(angle)]

Mathematical Tags

#perlin #fbm #noise #tendrils #flow-field #organic
Author: Math Art Core Target: 60 FPS

Export & Embed: Perlin Tendrils

4K PNG Snapshot

High-resolution single frame render

WebM Video (5s Loop)

60 FPS browser-captured stream

Standalone JS Script

Complete executable Canvas 2D algorithm

HTML Iframe Embed

<iframe src="https://art.fazleyrabbi.xyz/embed/perlin-tendrils" width="500" height="500" frameborder="0" loading="lazy"></iframe>
ESC
↑↓ Navigate Select
110 Mathematical Artworks
Made by Fazley Rabbi

Support the Project

Keep mathematical creative coding alive & open source

Or via Direct Payoneer ($0 Fee)
Payoneer Customer ID: $0 Fee Direct
24076084

💡 Payoneer app: Go to Pay → Pay to recipient → Enter ID 24076084.

Thank you for supporting generative mathematical animations! ✨