#How is a gradient trail effect created?

10 messages · Page 1 of 1 (latest)

sharp cairn
#

I saw this effect on Twitter. https://x.com/techartist_/status/2027794905150701715 How is this line created? Is it actually a line? Does the CPU update its historical position every frame? Can the line be modified via fragment shaders using shaderMaterial?

Evidence that chaos can be beautiful. Built with Three.js and GLSL shaders, this integrates dx/dt=sin(y)−b x, dy/dt=sin(z)−b y, dz/dt=sin(x)−b z. At b≈0.19 the Thomas attractor settles into a stable yet chaotic 3D geometry. 🔊

â–¶ Play video
gaunt jackal
#

You can probably use a Line type, or a "Ribbon" or lots of individual particles... or a virtual ribbon made of instanced quads... Quite a few ways to create that effect.
Also it looks like there is some heavy bloom post processing which always makes things look awesome. 😄

sharp cairn
sharp cairn
#

I suspect he constructed the entire geometry in JavaScript using vec3 v = sin(p.yzx) - bFactor * p;, then applied a shader to the geometry's material to achieve this effect.

gaunt jackal
sharp cairn
#

Is this a particle system constructed using GPGPU? Are each particle and its trail implemented within the same particle shader material? Is the trail direction adjusted based on velocity? Am I correct in my assumptions?

gaunt jackal
#

The particles are all simulated on the cpu, and output a triangle strip (ribbon).

sharp cairn
#

My CPU manages 60fps simulating this many particles per frame? I might have underestimated my CPU, LOL.

gaunt jackal
#

I have some other particle system examples that are gpgpu.. but none that use ribbons.

For a ribbon, you would treat each edge along the ribbon as the same particle, but at time + edge index.