diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2019-10-14 14:58:37 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2019-10-14 16:42:26 -0700 |
commit | 96a68810d21eeabf24985d9e07e897c6cb3aedd5 (patch) | |
tree | f59f39e39c260ff1d30619554e816c553fefc444 /src/modules/sparkler/particles.c | |
parent | a21f1febe29fbc2c7e00ff97913c04c247bfb95b (diff) |
modules/flui2d: add 2D fluid dynamics simulation
This implements near verbatim the code found in the paper titled:
Real-Time Fluid Dynamics for Games
By Jos Stam
It sometimes has the filename GDC03.PDF, or Stam_fluids_GDC03.pdf
The density field is rendered using simple linear interpolation of
the samples, in a grayscale palette. No gamma correction is being
performed.
There are three configurable defines of interest:
VISCOSITY, DIFFUSION, and ROOT.
This module is only threaded in the drawing stage, so basically the
linear interpolation uses multiple cores. The simulation itself is
not threaded, the implementation from the paper made no such
considerations.
It would be nice to reimplement this in a threaded fashion with a
good generalized API, then move it into libs. Something where a unit
square can be sampled for interpolated densities would be nice.
Then extend it into 3 dimensions for volumetric effects...
Diffstat (limited to 'src/modules/sparkler/particles.c')
0 files changed, 0 insertions, 0 deletions