Advertisement

GPU ray tracing

Started by December 19, 2022 04:16 PM
33 comments, last by Vilem Otte 1 year, 7 months ago

Just wait until you see the homing missile and lightning effects in conjunction with a gas emitter. LOL. Blows my mind.

p.S. I’m fascinated by quantum computing, though my knowledge of it is very small.

taby said:
Just wait until you see the homing missile and lightning effects in conjunction with a gas emitter. LOL. Blows my mind.

Somebody has shown me a video. It was a very hazy day, and they did some weapon testing.
The glowing projectiles scattered their light to the haze. Little projectiles became large, glowing laser bolts, and you could see and predict their trajectory.
This really looks awesome, and since that day, i think about some method on how we could eventually render this volumetric scattering effectively with little cost. Some fake would be fine. Just something.

Another scene i have in mind is, you go into some darker room or corridors, and there are little holes on the walls. Smoke drains out the walls. It flows downwards, forming nice plumes on its way.
And on the ground is a sea of smoke, which swirls up as you walk through it.
So i think about some method to do such simulations efficiently. My basic idea is to have higher resolution in the plane facing the camera, but low resolution in the direction of depth, which you can not see.
I have some idea of doing this with a cubemap of froxel grids, with a regular volume in the center. It might work. But if you move, the grids move too, causing resampling and dissipation on the simulation. So the observer would affect it, which won't look good.

So you're not alone with this dream. We all want large scale fluid simulation in games.

The most impressive fluid scene i saw was a kind of fluid ‘monster’ in Gears 5. It was toxic gas, kinda hunting the player, following him through holes in the walls or doors. Really cool.
They did it with a layered 2D approach, similar to shallow water simulations useful for seas or oceans. That's practical. Limited, but with some creativity? They got this working even across multiple floors in buildings.
It's not that detailed, though. No fine plumes or swirls. There is related research about adding such details with ML, much faster than simulation, and good enough. So maybe, sometime soon, fluid becomes an actually useful application of ML acceleration.
Maybe ML can fake volumteric lighting too for us? Maybe ML can do all the things, where we have failed… we will see : )

Advertisement

JoeJ said:
The most impressive fluid scene i saw was a kind of fluid ‘monster’ in Gears 5. It was toxic gas, kinda hunting the player, following him through holes in the walls or doors. Really cool.

Sorry for going a bit OT here - but I'm quite curious. I have played Gears 5 some time ago with my wife, but I can't remember this passage.

My current blog on programming, linux and stuff - http://gameprogrammerdiary.blogspot.com

Vilem Otte said:
I have played Gears 5 some time ago with my wife, but I can't remember this passage.

I have played it too, but did not finish it (although i liked it), and did not get that far i guess.

What i saw was a dev talk, maybe at GDC. Scene was kind of underground lab, with internal open windows. The toxic haze was draining through such windows, doors, and even downstairs to the next floor.

Now i tried really hard to find it again, but no, too bad. Maybe it did not made it into the final game, but i would't think so. I'm also quite sure i do not confuse the game with another.

No worries about OT – I'm the king of derailing a topic lol

Speaking of dark clouds, here is my fluid emitter for The Black Dog in The Black House, a novel co-written by Stephen King:

I absolutely will not consider 2D simulations. I love Stam's Stable Fluids (comes with GLUT source), and it looks great, but it's simply not 3D.

I will be using an orthographic camera, and a single 3D simulation that fits within the screen bounds and the near-far planes.

Advertisement

Here's a video that has one key ingredient that pretty much all other videos skip over, and that is branching.

taby said:
I absolutely will not consider 2D simulations. I love Stam's Stable Fluids (comes with GLUT source), and it looks great, but it's simply not 3D.

Stams fluids work in 3D too.
I never fully understood it, but actually it solves per dimension, so porting to 3D would be a matter of copy pasting those solver calls to the 3rd dimension. (At least in the code that i have found)
This ‘separable’ nature of the method is actually the reason i fail to grasp it. : ) Most intuitive fluid sim method to me is SPH.

It kinda sucks you need different methods for different materials. Stams (Eulerian Grid) is good for smoke and gas, SPH (Lagrangian particles) is good for water.
Then we have some mixed methods like APIC and MPM. MPM can do water as well, and even rigid materials, but i have not seen it being used for gas. Does not make much sense to model gas with particles.

JoeJ said:

taby said:
I absolutely will not consider 2D simulations. I love Stam's Stable Fluids (comes with GLUT source), and it looks great, but it's simply not 3D.

Stams fluids work in 3D too.

Oh yes, sorry, I didn't mean to imply that it couldn't be 3D. As far as I can tell, the Unreal Engine has the same features as Stam's work – such as things like how many iterations to use when solving for the pressure. But still, I'd rather see a mushroom cloud in 3D rather than a 2D cross-section of it.


I never fully understood it, but actually it solves per dimension, so porting to 3D would be a matter of copy pasting those solver calls to the 3rd dimension. (At least in the code that i have found)
This ‘separable’ nature of the method is actually the reason i fail to grasp it. : ) Most intuitive fluid sim method to me is SPH.

It kinda sucks you need different methods for different materials. Stams (Eulerian Grid) is good for smoke and gas, SPH (Lagrangian particles) is good for water.
Then we have some mixed methods like APIC and MPM. MPM can do water as well, and even rigid materials, but i have not seen it being used for gas. Does not make much sense to model gas with particles.

Excellent. Thank you for the explanation. I will also have a water gun in the shmup. LOL

taby said:
But still, I'd rather see a mushroom cloud in 3D rather than a 2D cross-section of it.

I see. The 3D fallacy…
But well, i'm a victim of that too. I can't be helped. Next game has to be fully 3D, or no game. : )

taby said:
the Unreal Engine has the same features as Stam's work

Seems they have quite a lot of stuff. I thought Niagara would be probably just particles driven by procedural vector fields like curl noise, with screenspace collisions. But they have proper simulations too i see.

How's the cost of this? How many such fluid boxes could you have in view?

This topic is closed to new replies.

Advertisement