Perlin Tendrils
Particles advecting through a multi-octave Fractal Brownian Motion (FBM) gradient field, forming delicate, branching filamentous structures.
60 FPS • Canvas 2D
Click + Drag to interact with field
</>
Full Executable Algorithm Code
103 lines
3312 chars
// 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=0∑kγiNoise(2ix,2iy+ωt))
Click to expand
∑
Perlin Tendrils
Full Mathematical System • organic
100%
Complete System of Equations
[Governing Law][Discrete Progression][Domain & Space][Parameter State]v(x,y,t)=∇×(i=0∑kγiNoise(2ix,2iy+ωt))angle=fbm(x⋅0.003,y⋅0.003+t⋅0.15)⋅4π,v=[cos(angle),sin(angle)]x∈R2,t∈R+,ω∈[0,2π]λparticleCount=1000(Tendril Particles),λnoiseScale=0.003(Noise Zoom Scale),λspeed=1.5(Advection Speed)
v(x,y,t)=∇×(i=0∑kγiNoise(2ix,2iy+ωt))
Computational Implementation (JavaScript Engine Equivalent)
angle = fbm(x * 0.003, y * 0.003 + t * 0.15) * 4π, v = [cos(angle), sin(angle)] 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
Press ESC or F to exit