flat assembler
Message board for the users of flat assembler.

Index > Projects and Ideas > Physically Based Fluid Effect

Author
Thread Post new topic Reply to topic
donn



Joined: 05 Mar 2010
Posts: 315
donn 29 Mar 2022, 05:29
Experimenting with the Navier Stokes Equations to visualize fluids. Just uploaded a video of some early results:

"Physically Based Fluid Effect" https://youtu.be/HGWMK2RYWoM

Fluid is slightly viscous and features vorticity confinement.

The orchestration of the compute shaders is done 100% with fasmg making calls to Vulkan. The calculations are mostly done in Vulkan's Compute Shaders unfortunately, but I have a plan to switch to something better, more fasm-like (SPIR-V).

There are 6 shaders: Advection, Divergence, Jacobi Integration, Projection, Torques, and visualization.

The fluid test is currently very tightly tied to a bigger project, would not be useful to share in its entirety as is. Can speak to how any specific sections work though and probably share snippets if desired.

Also did the music in the video as an improv, more to come. Next steps are numerous, but include working with gravity, differentiating between specific kinds of fluids, improving lighting and detail, including buoyancy etc.



References
______________________________
J. Stam. Stable Fluids. August 1999
M. Harris. Fast Fluid Dynamis Simulation on the GPU. 2004
K. Crane, et al. Real-Time Simulation and Rendering of 3D Fluids. 2007
R. Fedkiw, et al. Visual Simulation of Smoke. 2001
A. Selle, et al. A Vortex Particle Method for Smoke, Water and Explosions. 2005
J. Steinhof. Modification of the Euler equations for "vorticity confinement":
Application to the computation of interacting vortex rings. 1994


Description:
Filesize: 108.08 KB
Viewed: 2081 Time(s)

Thumbnail.JPG


Post 29 Mar 2022, 05:29
View user's profile Send private message Reply with quote
donn



Joined: 05 Mar 2010
Posts: 315
donn 12 Oct 2022, 04:46
Just finished this project. Now have a liquid that is influenced by gravity and interacts with obstacles

Scene of a TOXIC FLUID:
https://youtu.be/THH_ymq69ok

A ton of other improvements too, including:
- Better visualization 1920x1080 screen (HD)
- Up to 125 samples per path (Path Tracing), though visualization is still a bit unstable and crude, crashed during many renders
- Maccormack advection
- Interpolation of level sets, visualization, etc with Monotonic Cubic Hermites
- Vorticity Confinement (swirls, more realism)
- Multiple direct lights, diffuse and specular

Method:
- 100% orchestration of Vulkan (OpenGL successor) from fasmg, dispatching compute shaders, copying memory buffers, etc.
- Compute kernels in GLSL, still haven't built with SPIR-V yet from fasmg though I did some tests. Also have some great samples to work with in decompiled shaders.
- Trickiest part on fasmg side was in binding the resources used in each shader as I needed more and more. Defined the layouts in data sections and used a builder pattern to traverse and build them. Each buffer definition was a sequence of dqs but Vulkan is very tricky and you have to be careful that Resource Descriptors, binding slots, etc each line up.

Did the music myself and first time writing and playing guitar instruments so go easy on me! Any feedback welcome, however.


Description:
Filesize: 259.07 KB
Viewed: 1525 Time(s)

Thumb.JPG


Post 12 Oct 2022, 04:46
View user's profile Send private message Reply with quote
NETSTALKER



Joined: 17 Apr 2020
Posts: 8
Location: fidonet
NETSTALKER 12 Jan 2023, 13:42
Hello. This is a very interesting project. Can you show the source code?
Post 12 Jan 2023, 13:42
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.