Live data from Hacker News

Simulating fluids, fire, and smoke in real-time

andrewkchan.dev

41–50 of 174 posts

Re: Simulating fluids, fire, and smoke in real-time

#42

Earlier quoted context omitted.

> It looks like the GPU is doing most of the work Yes. The GPU is doing most of the work in a lot of modern games. It isn't great at everything though, and there are limitations due to its architecture being structured almost solely for the purpose of computing massively parallel instructions. > when do we start to wonder if the GPU can “offload” anything to the whole computer that is hanging off of it The main bottl…

I’m pretty sure CPUs destroy GPUs at sequential programming and most programs are written in a sequential style. Not sure where the 90/10 claim comes from but there’s plenty of cloud servers with no GPU installed whatsoever and 0 servers without a CPU.

Yup, and until we get a truly general purpose compute GPU that can handle both styles of instruction with automated multi-threading and state management, this will continue.

What I've seen shows me that nVidia is working very hard to eliminate this gap though. General purpose computing on the GPU has never been easier, and it gets better every year.

In my opinion, it's only a matter of time before we can run anything we want on the GPU and realize various speed gains.

As for where the 90/10 comes from, it's from the emerging architectures for advanced AI/graphics compute like the DGX H100 [0].

[0] https://www.nvidia.com/en-us/data-center/dgx-h100/

Re: Simulating fluids, fire, and smoke in real-time

#44

As a person who did a PhD in CFD, I must admit I never encountered the vorticity confinement method and curl-noise turbulence. I guess you learn something new every day! Also, in industrial CFD, where the Reynolds numbers are higher you'd never want something like counteracting artificial dissipation of the numerical method by trying to applying noise. In fact, quite often people want artificial dissipation to stabil…

I think the curl noise paper is from 2007: https://www.cs.ubc.ca/~rbridson/docs/bridson-siggraph2007-cu... I've used the basic idea from that paper to make a surprisingly decent program to create gas-giant planet textures: https://github.com/smcameron/gaseous-giganticus

reminds me of this - https://www.taron.de/forum/viewtopic.php?f=4&t=4

it's a painting program where the paint can be moved around with a similar fluid simulation

Re: Simulating fluids, fire, and smoke in real-time

#45
post #8

Page is basically unusable on my Intel MBP, and still a beastly consumer on my AS Mac. I presume simulations are happening somewhere on the page, but it would be a good idea to make them toggled. Ideally via user interaction, but if one insists on auto-play when scrolled into the viewport.

Seems to work only in Safari, using Chrome I can't scroll past the first quarter of the page and CPU is at 100%.

Re: Simulating fluids, fire, and smoke in real-time

#46
post #8

Page is basically unusable on my Intel MBP, and still a beastly consumer on my AS Mac. I presume simulations are happening somewhere on the page, but it would be a good idea to make them toggled. Ideally via user interaction, but if one insists on auto-play when scrolled into the viewport.

Interestingly, no noticeable performance issues on my M2 MacBook Air. Maybe he's already made some of the changes you recommended?

Testament to the insane power and efficiency of Apple silicon

Re: Simulating fluids, fire, and smoke in real-time

#48

As a person who did a PhD in CFD, I must admit I never encountered the vorticity confinement method and curl-noise turbulence. I guess you learn something new every day! Also, in industrial CFD, where the Reynolds numbers are higher you'd never want something like counteracting artificial dissipation of the numerical method by trying to applying noise. In fact, quite often people want artificial dissipation to stabil…

> Guess the requirements in computer graphics are more inclined towards making something that looks right instead of getting the physics right.

The first rule of real-time computer graphics has essentially always been "Cheat as much as you can get away with (and usually, even if you can't)." Also, it doesn't even have to look right, it just has to look cool! =)

Re: Simulating fluids, fire, and smoke in real-time

#49
post #8

Page is basically unusable on my Intel MBP, and still a beastly consumer on my AS Mac. I presume simulations are happening somewhere on the page, but it would be a good idea to make them toggled. Ideally via user interaction, but if one insists on auto-play when scrolled into the viewport.

Runs buttery smooth on my M2 here in Safari on macOS 14.2.1

Tried them out in Chrome and they're mostly all the same though I do notice a slight jitter to the rendering in the smoke example.

Re: Simulating fluids, fire, and smoke in real-time

#50
post #4
post #2

it blows my mind that cfd is a thing we can do in real time on a pc

Yes, we can since a long time. They were already a thing 14 years ago on the PS3 in the game "Pixeljunk shooter" [0]. But real time simulations often use massive simplifications. They aim to look real, not to match exact solutions of the Navier-Stokes equations. [0] https://www.youtube.com/watch?v=qQkvlxLV6sI

Heck, the Wii had Fluidity around the same time period (2010), and that's a lot weaker than the PS3. Fluidity was pretty neat—you played as a volume of water, changing states as you moved through a level that looked like a classic science textbook:https://youtu.be/j7IooyXp3Pc?si=E79rCrq2mdyZSKoF&t=120
Post reply on HN