Realtime GPU smoke simulation

For now a lot of work with my studies as I’m finishing the bachelor’s degree, so less time for programming BUT more time for doing the planning stage so hopefully when I have more time the actual writing of the code will go significantly faster.

It’s not that I don’t have any new updates but they are just very rough as I implemented the first version of narrow-band like simulation which in the final form will be faster & less memory hungry but for now it’s just faster and much MORE memory hungry. But it’s like 3-4x faster at average and mostly even more but it’s still a bit buggy as it’s not based on any paper but on my own idea as I wanted to do it a bit better. I will give some samples soon but first I need to make it more visually stable

15 Likes

Thanks so much :blush: I’m really hopefull that I could do something useful

3 Likes

Okey, so as it’s now more stable than me than I’ve decided to do a little video with an explanation what I did and how much it’s faster (spoiler alert!!!) (from ~400ms/frame to ~120ms/frame) (!!!spoiler alert) for the level of detail of 70,000,000 particles.

So not great not terrible. I’ll be working on that more so hopefuly it’ll be faster in the future. And for the video link it’s below:

20 Likes

Your progression for the software is really great I appreciate that but till around what time you are planning to integrate with blender mantaflow or apply the smoke simulator or the liquid simulator as a addon for blender as your software is in realtime which is very efficient.Also thanks for making such wonderful softwares they are very useful and handy

1 Like

Hi michal1000w, i thought you might want to know, that Sebastian Barschkis, the maintainer of mantaflow, doesn`t work for blender institute anymore. They might be looking for someone to takle that ??? I remember you wrote that you might want to add it to blender. Maybe you get a fund or something ???

4 Likes

Hi :smiley: thanks for telling me. Yes, I would love to add it to blender and it would be an honor if it would ever be accepted (not mentioning that working at blender would be a dream-job). I’m afraid however that I may be a little too stupid for that as my work is fast but still far from being production ready :frowning: . If I get a fund however I could work full time on both simulators instead of trying to make money as an AI engineer during the day, then afterwork doing the masters degree, in any free time trying to have a life aaaand spending nights on the simulator. As for now it’s just too much for me and that makes the development much much slower and from some time quite unpleasent.
But thanks for beliving in the project as it keeps me going. Without that I would give up a long ago as more and more I feel that nobody really cares :frowning:
Have a nice day everysoul reading this and I hope You feel good in this time of darkness

26 Likes

Hi, i can imagine this is tough. I can`t program myself just a little scripting. Pablo said on yesterdays Blender Today they are looking for a new maintainer for mantaflow. Maybe you can apply. That would solve some problems. I am just desperate, because there is only one realtime simulator and that is very expensive. I wonder why you are the only one to do a free one, since there is the opportunity to do it on gpu now. I understand its very complicated stuff, but there must be a demand for that. I was baffled to hear that Sebastian quit after introducing a first draft for a realtime mantaflow.

3 Likes

To keep you motivated:

𝘈𝘴 𝘧𝘢𝘳 𝘢𝘴 𝘐’𝘷𝘦 𝘣𝘦𝘦𝘯 𝘧𝘰𝘭𝘭𝘰𝘸𝘪𝘯𝘨 𝘉𝘭𝘦𝘯𝘥𝘦𝘳, 𝘐 𝘵𝘩𝘪𝘯𝘬 𝘵𝘩𝘢𝘵 𝘵𝘩𝘦 𝘥𝘢𝘺𝘴 𝘰𝘧 𝘔𝘢𝘯𝘵𝘢𝘍𝘭𝘰𝘸, 𝘬𝘦𝘱𝘵 𝘧𝘰𝘳 𝘺𝘦𝘢𝘳𝘴 𝘪𝘯 𝘵𝘩𝘦 𝘱𝘩𝘺𝘴𝘪𝘤𝘴 𝘱𝘳𝘰𝘱𝘦𝘳𝘵𝘪𝘦𝘴 𝘱𝘢𝘯𝘦𝘭 𝘢𝘳𝘦 𝘧𝘪𝘯𝘢𝘭𝘭𝘺 𝘤𝘰𝘮𝘪𝘯𝘨 𝘵𝘰 𝘢𝘯 𝘦𝘯𝘥. 𝙊𝙣𝙚 𝙤𝙛 𝘽𝙡𝙚𝙣𝙙𝙚𝙧’𝙨 2022 𝙎𝙩𝙧𝙖𝙩𝙚𝙜𝙞𝙘 𝙏𝙖𝙧𝙜𝙚𝙩𝙨 𝙞𝙨 𝙞𝙣𝙩𝙚𝙜𝙧𝙖𝙩𝙞𝙣𝙜 𝙋𝙝𝙮𝙨𝙞𝙘𝙨 𝙖𝙨 𝙣𝙤𝙙𝙚𝙨. 𝙎𝙤 𝙥𝙧𝙤𝙗𝙖𝙗𝙡𝙮 𝙗𝙮 𝙩𝙝𝙚 𝙚𝙣𝙙 𝙤𝙛 𝙩𝙝𝙞𝙨 𝙮𝙚𝙖𝙧, 𝙩𝙝𝙚𝙮 𝙬𝙞𝙡𝙡 𝙨𝙪𝙧𝙚𝙡𝙮 𝙗𝙚𝙜𝙞𝙣 𝙖 𝙋𝙝𝙮𝙨𝙞𝙘𝙨 𝙉𝙤𝙙𝙚𝙨 𝙥𝙧𝙤𝙟𝙚𝙘𝙩, 𝙞𝙣 𝙤𝙧𝙙𝙚𝙧 𝙩𝙤 𝙢𝙖𝙠𝙚 𝙥𝙝𝙮𝙨𝙞𝙘𝙨 𝙬𝙤𝙧𝙠 𝙬𝙞𝙩𝙝 𝙜𝙚𝙤𝙢𝙚𝙩𝙧𝙮 𝙣𝙤𝙙𝙚𝙨. 𝙏𝙝𝙚𝙮 𝙖𝙡𝙨𝙤 𝙬𝙖𝙣𝙩 𝙩𝙝𝙚 𝙣𝙚𝙬 𝙨𝙮𝙨𝙩𝙚𝙢 𝙩𝙤 𝙬𝙤𝙧𝙠 𝙞𝙣 𝙍𝙀𝘼𝙇-𝙏𝙄𝙈𝙀. 𝙏𝙝𝙚𝙧𝙚𝙛𝙤𝙧𝙚 𝙩𝙝𝙚𝙮 𝙬𝙞𝙡𝙡 𝙨𝙪𝙧𝙚𝙡𝙮 𝙛𝙖𝙘𝙚 𝙖 𝙨𝙘𝙖𝙧𝙘𝙞𝙩𝙮 𝙛𝙤𝙧 𝙝𝙞𝙜𝙝𝙡𝙮 𝙨𝙠𝙞𝙡𝙡𝙚𝙙 𝙙𝙚𝙫𝙚𝙡𝙤𝙥𝙚𝙧𝙨 𝙖𝙩 𝙩𝙝𝙖𝙩 𝙩𝙞𝙢𝙚. 𝚃𝚑𝚎𝚢 𝚖𝚒𝚐𝚑𝚝 𝚝𝚑𝚒𝚗𝚔 𝚘𝚏 𝚑𝚒𝚛𝚒𝚗𝚐 𝚗𝚎𝚠 𝚍𝚎𝚟𝚎𝚕𝚘𝚙𝚎𝚛𝚜 𝚏𝚘𝚛 𝚝𝚑𝚎 𝚙𝚛𝚘𝚓𝚎𝚌𝚝, 𝚘𝚛 𝚎𝚟𝚎𝚗 𝚛𝚎𝚊𝚌𝚑 𝚘𝚞𝚝 𝚍𝚒𝚛𝚎𝚌𝚝𝚕𝚢 𝚝𝚘 𝚙𝚎𝚘𝚙𝚕𝚎 𝚕𝚒𝚔𝚎 𝚢𝚘𝚞 𝚏𝚘𝚛 𝚑𝚎𝚕𝚙! 𝙷𝚘𝚙𝚎𝚏𝚞𝚕𝚕𝚢 𝚢𝚘𝚞 𝚜𝚑𝚊𝚕𝚕 𝚑𝚊𝚟𝚎 𝚊 𝚐𝚛𝚎𝚊𝚝 𝚝𝚒𝚖𝚎 𝚎𝚕𝚎𝚟𝚊𝚝𝚒𝚗𝚐 𝚝𝚑𝚎 𝚌𝚊𝚙𝚊𝚋𝚒𝚕𝚒𝚝𝚒𝚎𝚜 𝚘𝚏 𝙿𝚑𝚢𝚜𝚒𝚌𝚜 𝙽𝚘𝚍𝚎𝚜 𝚒𝚗 𝚝𝚑𝚎 𝚜𝚘𝚏𝚝𝚠𝚊𝚛𝚎 𝚢𝚘𝚞 𝚕𝚘𝚟𝚎!!

8 Likes
2 Likes

That looks promising, especially the multi-material mix and it’s way more polished than my simulators. The only thing that I see mine doing better are the baking times. As test below shows a quite fast baking

  • 6.8M points
  • 300 frames (at 24fps)
  • 40 minutes bake time (CUDA)
    however my SPH solver does 80M points in about 26fps in realtime. But overall I’ll have a closer look at Taichi :slight_smile:
7 Likes

Bro. If I read the numbers below that right, that was the understatement of the century and you’re humbleness is awe inspiring.

6.8M points with a 40 min bake time
vs
80M points in real time

Did I read that right?

1 Like

To be exact:

120ms/frame for 80M particles it is
However it’s 120ms for simulation + meshing + rendering
So for just sim it’s a bit faster

Still a bit buggy tho and lacking features

Ahh. Cool. Any chance you both could put your brains together and collab?
Your work is out of my skill level ATM, otherwise I’d totally help out. ATM I’m working on basic stuff like prototyping and implementing grouping. lol

1 Like

I mean if they would like to then I’m open. My goal is nothing more than to do something useful for anyone who like simulations as I’m myself in the situation where I like doing vfx etc. but I have just no money for Emb** *** and Hou**** and Mantaflow is great but not the fastest on the huge scale.
So one day I just thought why not to do it myself (still knowing that I’m not exactly bright enough for that). But the prototypes are working so with some help it should be initially ready in short time (or with enough money to drop current job and sit only on the sims because now I have too little time for huge steps) (and not production ready but like… hobby ready).

And sorry for that long monolog :frowning: Hope it makes sense

5 Likes

For sure I hear ye. I hope that they’ll be able to help you. I’ll work on banging out this group feature as fast as I can and a couple of other high priority stuff on my plate and see if I can help you in whatever way I can. Perhaps with a good introduction from you on your code and how it works I can be of service :slight_smile:

1 Like

Thanks a lot :smiley:
I’ll try to do an introduction to my code when I’ll make it more readable, as for now it’s a total mess. Like I have to pray to the Sphagetti Monster when I’m sitting in front of it (for the fluid sim at least as the smoke sim is much more clear). And I know it’s a really bad practise but with so little time most often I just write ideas as fast as I can and work on them until they are functioning properly and after that sprint I make a little refactor to make it not only work good but also look good. But when I have a lot of time for a project I usually try to make it as clear as possible from the beginning.

2 Likes

Haha. For sure! I can help you with stuff like formatting and organization / commenting no problem if I know what’s up.

Digging into the blender code base the last month and to trying and figure out how it works has been a nightmare. Stuff in there is all over the place with almost no comments. Hahaha. So you’re not alone by any means.

1 Like

Okey. Sooooo long time no updates. The reason why is that I’m working on a new Smoke solver (and new iteration of the renderer), as the old one was fast (about 30fps for a huge domain), however it has some problems like:

  • uses a lot of memory, so on a 8GB card the max domain was about 500^3
  • the domain size was huge but the actual amount of detail was quite low
  • above 500^3 it gets really slow compared to the smaller scale
  • a lot of internal limitations

That’s why I decided to rethink the entire concept of how to do this (again). And today I’ve finished the first draft. To be honest I’m not so happy about how it turned out, as the simulation times feels much slower than the old ones when it comes to the relation of domain size → sim time, however on the contrary it looks A LOT better in terms of details and overall smoke behaviour. What’s more it uses over 3x less memory and the scaling of sim time vs resolution is a bit better when it comes to a huge scale. So it kinda is better but still there is a huge field for improvements in my opinion.

19 Likes

In summary it is fast, but I wouldn’t call it realtime. 968x624x408 domain is simulating at about 0.85sec /frame. So not great, not terrible but until it is in frames per second it won’t be called anywhere near “ready”

9 Likes

Here’s the sample image simulated and rendered in the new version

37 Likes