Realtime GPU smoke simulation

I would definitelly need some help with OpenVDB support, because for now I’m really short on time and I have encountered some bugs during the installation so if someone knows anything it would be awesome :slight_smile:

1 Like

Some time ago I’ve also find an Open Source Liquid simulator with GPU support called fluids3 from 2013. The whole system looks promising however there are some limitations:

  • It works in 32bit
  • max 8,000,000 particles limit
  • hard to use code and almost no documentation (at least I have not found one)
  • max CUDA version of 5.5
  • no maintanance

Because of that I’ve decided to try reverse engeneer it and rewrite to allow for easy implementation in blender and to remove above limitations.
By now I’ve managed to remove the particle limit to be your GPU memory (about 24,000,000 on RTX2080), works in 64bit, CUDA 11.

This is though a side project of my side project so I don’t know when it would be ready but it’s definitelly something that can be done

For now I have some bugs but when the demo would be ready I’ll send some videos

5 Likes

Your work is amazing!

I am curious though (I have little to no GPU experience); is CUDA not backwards compatible? I guess my main question is how is there a MAX CUDA version for this? Usually, at least based on what I understand there is a minimum software version requirement.

1 Like

Unfortunately CUDA is not entirely backwards compatible. I mean most of the time the same code should work with newer version of CUDA, but in some versions there are too many changes done in CUDA Toolkit and it requires some work to adapt the code to compile. And even if the code compiles the application sometimes has some runtime errors.

3 Likes

After many days of work there finally is an initial NanoVDB support. It contains saving simple sphere to a file and then reading it and adding to scene. It may not seem impressive, however it was still a lot of coding. Below there is a simple explosion I’ve made.

Some future work will be in the OpenVDB support (for now I have some problems with compilation), however I might change plans due to some better ideas in other areas.

19 Likes

I cannot believe someone is actually doing this!
This is truly amazing, great job!!!

2 Likes

Initial OpenVDB exporting is done. There are some problems however. Saving is extremely slow and files are huge so there need to be some more work done to make it shine.
But it works :slight_smile: after many days of bugfixing.

Below there is a screen from blender.

21 Likes

Truly amazing! Hoping one day your work will be merged in Blender official!

2 Likes

After doing some research in documentation of OpenVDB I have not found any tips for multithreaded exporting which is unfortunate, because simulation times are about 45ms and saving time for this file is almost 3000ms. That makes it definitelly not real time so I have to do some heavy rewrites to make it faster :frowning:.

But if anyone has some tips it would be welcome

minor comment: could you add the GitHub link to the top post?

1 Like

Yes, thanks for response. I’ve just added it, however the code for now is a mess and a one huge experiment without any documentation so I’m not sure it is worth anyone time to dive into it.

It would be rewritten in the future but for now I don’t have time for it :pensive:

Weekend starts so there is time for rewriting it from the beginning. :smiley:

12 Likes

After many hours of work, thousands lines of code and learning OpenGL from scatch there is a simple GUI (for now at least it’s only a real-time preview of our simulation but it would be extended and contain some controls)

Below there is a video sample:

17 Likes

I’ve added some new GUI funcionality. Now we can go forward-backward with scroll or W/S, left/right with A/D or with A/D+Left mouse button it will rotate.
Also with R you can reset the simulation.

Some new funcionality will be added in the future :slight_smile:

11 Likes

Hi, It’s me again.
I’ve just managed to finalize the first GUI draft and also added some basic funcionality.

Results can be seen in the video below

9 Likes

Hi Michal, great work! Do you think that your project could be integrated with or inspired by Mantaflow? I say that as I see that you’ve got quite a road map with flip fluids simulation over the long term.

2 Likes

Hi, Thank you.
Ideally I would like to integrate it fully with blender aside Mantaflow, however for now I see some big problems with blender’s perfomance in displaying volumetric data.
For example what you can see in the video was simulated and rendered in real time. After exporting the same scene to blender it took almost an hour to display it in the viewport and much longer to render. So for now it would be a standalone with option to export OpenVDB files and in the future some more integration changes would be made.

1 Like

If Blender is that slow at the moment, does this mean you will have to add a sort of object or scene parser (GLTF or USD for instance) in your project to make fluid and gas simulation interact with objects made by users? Or directly using functions in OpenVDB to load and voxellize meshes given by users?

Object loading and collisions are still at drawing table and I’m experimenting with the best ways to do the interaction, however it would definitelly be combined with some kind of scene exporting.

Saving options were added :smiley:
However exporting with maximum resolution still is definitelly too slow so I have to do something with it.
Below there is video with blender integration.

14 Likes