GitHub
Translate

Opens Google Translate in a new tab. Website translation availability varies by region. Details

WebGL2 Shader • Ping-Pong FBO

Fluid

Real-time 2-channel dye and velocity advection stored in Ping-Pong Framebuffer Objects. Moving your pointer injects velocity trails that combine with the canvas using Additive Color Blending (ACD), and clicking triggers radial splashes.

Live Playground

Ping-Pong FBO Move & Click to Splash
Dissipation 0.975
Swirl 1.40
Radius 0.0045

Where to Use It

Creative Studio & Agency Headers

Reward curious visitors with responsive cursor dye trails and click-burst splashes on interactive cover pages.

Music, Festival & Launch Pages

Reactive fluid ribbons respond smoothly to fast pointer gestures and touch swipes at 60 FPS.

Usage (Copy & Paste)

<section
  data-fx="fluid"
  data-fx-dissipation="0.975"
  data-fx-radius="0.0045"
  data-fx-swirl="1.4"
  style="min-height: 60vh;"
>
  <div style="position: relative; z-index: 1;">Interactive Fluid</div>
</section>
<script src="https://unpkg.com/@votax572002/fluxfx/dist/fluxfx.min.js"></script>
'use client';
import { Fluid } from '@votax572002/fluxfx/react';

export function FluidHero() {
  return (
    <Fluid dissipation={0.975} radius={0.0045} swirl={1.4} style={{ minHeight: '60vh' }}>
      <h1>Fluid Simulation</h1>
    </Fluid>
  );
}
import { FluxFX } from '@votax572002/fluxfx';

FluxFX.apply(el, 'fluid', {
  dissipation: 0.975,
  radius: 0.0045,
  swirl: 1.4,
  speed: 1.0,
});

How It Works (Flowchart)

Read uPrevFrame RG: vel, BA: dye Curl & Advection uSwirl + pointer impulse Swap Ping-Pong FBO RGBA16F / RGBA8 Specular Shade Height-normal sheen

Props & Attributes

HTML AttributeJS / React PropTypeDefaultDescription
data-fx-dissipationdissipationnumber0.975Trail fade retention (0.90–0.996).
data-fx-radiusradiusnumber0.0045Cursor brush splash radius.
data-fx-swirlswirlnumber1.4Vorticity curl strength.
data-fx-speedspeednumber1.0Advection speed multiplier.
data-fx-colorscolorsstring | string[]['#6366f1','#06b6d4','#f43f5e']3-stop fluid dye palette.