Live data from Hacker News

Simulating fluids, fire, and smoke in real-time

andrewkchan.dev

111–120 of 174 posts

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

#111

Earlier quoted context omitted.

Not being a graphics person, is this what hardware ray tracing is, or is that something different?

Rayteacing doesn't simulate light, it simulates a very primitive idea of light. There's no diffraction, no interference patterns. You can't simulate the double-slit experiment in a game engine, unless you explicitly program it. Our universe has a surprising amount of detail. We can't even simulate the simplest molecular interactions fully. Even a collision of two hydrogen atoms is too hard - time resolution and space…

And what’s more, it simulates a very primitive idea of matter! All geometry is mathematically precise, still made of flat triangles that only approximate curved surfaces, every edge and corner is infinitely sharp, and everything related to materials and interaction with light (diffuse shading, specular highlights, surface roughness, bumpiness, transparency/translucency, snd so on) are still the simplest possible models that five a somewhat plausible look, raytraced or not.

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

#112

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…

Maybe you're not the right person to ask, but I'll go anyway: I would like to learn the basics of CFD not because I expect to do much CFD in life, but because I believe the stuff I would have to learn in order to be able to understand CFD are very useful in other domains.

The problem is my analysis is very weak. My knowledge about linear algebra, differential equations, numerical methods, and so on is approximately limited at the level of an introductory university course. What would you suggest as a good start?

I like reading, but I also like practical exercises. The books I tried to read before to get into CFD were lacking in practical exercises, and when I tried to invent my own exercises, I didn't manage to adapt them to my current level of knowledge, so they were either too hard or too easy. (Consequently, they didn't advance my understanding much.)

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

#113

I wrote a super simple flame simulation a long time ago as a toy in C after reading an article somewhere. You just set each pixel’s brightness to be the average brightness of the immediately adjacent pixels. Calculate from bottom to top. Add a few “hot” pixels moving back and forth along the bottom and boom, instant fire. Looks very cool for a tiny amount of code and no calculus. :)

> no calculus "set each pixel’s brightness to be the average brightness of the immediately adjacent pixels" sounds like a convolution ;)

It's a trick! Calculus puts me right off, but explain it in code and visualizable ways and I'm on board.

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

#114

Earlier quoted context omitted.

This was the big realization for me when I got into graphics - everything on the screen is a lie, and the gestalt is an even bigger lie. It feels similar to how I would imagine it feels to be a well-informed illusionist - the fun isn’t spoiled for me when seeing how the sausage is made - I just appreciate it on more levels.

My favorite example of the lie-concealed-within-the-lie is the ‘Half-Life Alyx Bottles’ thing. Like, watch this video: https://www.youtube.com/watch?v=9XWxsJKpYYI This is a whole story about how the liquids in the bottles ‘isn’t really there’ and how it’s not a ‘real physics simulation’ - all just completely ignoring that none of this is real . There is a sense in which the bottles in half-life Alyx are ‘fake’ - that…

I want to see that shader. How is sloshing implemented? Is the volume of the bottle computed on every frame?

Clearly, there's some sort of a physics simulation going on there, preserving the volume, some momentum, and taking gravity into account. That the result is being rendered over the shader pipeline rather than the triangle one doesn't make it any more or less "real" than the rest of the game. It's a lie only if the entire game is a lie.

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

#115
post #70

Earlier quoted context omitted.

Hard to say whether economically a PhD always makes sense, but it certainly can open doors that are otherwise firmly closed.

Well, sure. Everything you end up doing in life will open doors that would have otherwise remained firmly closed if you did something else instead.

"Everything you end up doing in life will open doors that would have otherwise remained firmly closed"

Oh no. It is also quite possible to do things, that will very firmly close doors, that were open before, or making sure some doors will never open ..

(quite some doors are also not worth going through)

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

#116
post #19

Earlier quoted context omitted.

Now that LLMs run on GPU too, future GPUs will need to juggle between the graphics, the physics and the AI for NPCs. Fun times trying to balance all that. My guess is that the load will become more and more shared between local and remote computing resources.

Maybe in the future, personal computers will have more than one GPU, one for graphics and one for AI?

What do you mean in the future? Multiple GPU chips is already pretty common (on the same card or having multiple cards at the same time). Besides, GPUs are massively parallel chips as well, with specialized units for graphics and AI operations.

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

#117
post #112

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…

Maybe you're not the right person to ask, but I'll go anyway: I would like to learn the basics of CFD not because I expect to do much CFD in life, but because I believe the stuff I would have to learn in order to be able to understand CFD are very useful in other domains. The problem is my analysis is very weak. My knowledge about linear algebra, differential equations, numerical methods, and so on is approximately l…

You'll be able to understand the equations I guess. The hard part is the numerical analysis: how do you prove your computations will: 1/ reach a solution (badly managed computations will diverge and never reach any solution) 2/ reach a solution that is close to reality ?

For me that's the hard part (which I still don't get).

You could start with Saint Venant equations, although they look complicated they're actually within reach. But you'll have to understand the physics behind first (conservation of mass, of quantity of movement, etc.)

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

#118
post #6

Interesting. I have 64GB of RAM and yet this page managed to kill the tab entirely.

Do you have hardware acceleration disabled in your browser?

I checked and I have it enabled. But, I don't have a dedicated GPU, just whatever is inside of i7-14700k. Maybe it's just not up for the task?

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

#119

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…

This is unfortunately a discussion I've had to have many times. "Why does your CFD software take hours to complete a simulation when Unreal Engine can do it in seconds" has been asked more than once.

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

#120

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 went to a talk by a guy who worked in this space in the film industry and said one of the funniest questions he ever got asked was "Can you make the water look more splashy"
Post reply on HN