Skip to content

Simple 2D implementation of Stam's Stable Fluids algorithm, currently TypeScript only no GPU

Notifications You must be signed in to change notification settings

sbobyn/stable-fluids.ts

Repository files navigation

Stable Fluids

This project is a simple Eularian fluid simulator based on Jos Stam's Stable Fluids Method.

The implementation closely follows the one described in the paper Real-Time Fluid Simulation for Games.

The implementation is written entirely in TypeScript on the CPU and rendered with the HTML canvas API (no shaders used for rendering or the fluid solving) so the resolution of the simulation is limited but still enough for interesting results.

A demo for the project is available here https://sbobyn.github.io/stable-fluids.ts/

Demos

RGB Smoke Dyes

RGB Demo

Wind Tunnel

Wind Tunnel Demo

Vector Field

Vector Field Demo

Follow ups

  • GPU based solver with WebGL shaders + fast rendering with simple frag shader
  • 3D
  • more methods
    • vorticity confinement
    • Hybrid methods (PIC, FLIP, APIC, Poly PIC)
    • SPH
    • level sets for surface reconstruction
    • DL-based

About

Simple 2D implementation of Stam's Stable Fluids algorithm, currently TypeScript only no GPU

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published