Skip to content

◌ Folio MMXXVII

Loading folio

000

§02.01 — Lab Playground

FluidDynamicsShader

Custom GLSL fragment shader implementing a lightweight Navier–Stokes simulation for interactive background distortions.

  • Tech

    GLSL · 2027

  • Status

    Live

  • Renderer

    WebGL2 / fallback

  • Updated

    MMXXVII

Live · move the cursor
GLSL · 202760 fps target

◊ Brief

An advection-only Navier–Stokes pass running on a single fragment shader. The cursor seeds vortices into the velocity field; the field samples the same texture again to displace itself.

  • viscosity0.018
  • advection step0.36
  • vortex strength1.4
  • decay0.985

§README

  1. §01Fluid sims are usually multi-pass. This one is single-pass — at 60fps that's a tradeoff worth taking on the web.
  2. §02Cursor velocity is integrated over 8 frames so single mouse jitters don't spawn ugly vortices.
  3. §03Falls back to a static gradient on Swiftshader (yes, the Devin VM).