Modelling better explosions

Started by
15 comments, last by TAX 20 years, 5 months ago
I have just started up a project where I will examine how I can use Cg in modelling realtime explosions. The goal is to make a type of explosion based on particles that can handle collisions with the enviroment. (walls etc.) I need to examine ways to model flow in the exlosion. Therefore I am looking for a good practical introduction to solving the incompressible navier-stokes for a 3D grid. Any books, papers or perhaps examples would be much appreciated. TAX
Advertisement
Someone posted a fleshy/putty type simulator as a flipcode IOTD (looks like a deformed hand in one pic) very recently. He has a physics page (his link) which has just what you''re looking for I guess.

-Meto
Go to Citeseer and make a search for "Modelling of Smoke Flow Taking Obstacles into Account" by Satoru Yoshida. On Citeseer, check the linked papers, you should read "Modelling the Motion of a Hot, Turbulent Gas" and "Physically Based Modeling and Animation of Fire". Similar methods have been used by Ken Musgrave and they really look nice (but not in realtime)

http://citeseer.nj.nec.com/cs
http://www.kenmusgrave.com/animations.html

I''m just saying this off the top of my head, but:

Could you use a spring model with very weak springs between each particle?

For added realism you could make the spring force unidirectional. ie: No pull force, only push. This would allow hot gas to push other hot gas, but not pull it.

Will

------------------http://www.nentari.com
Look for Jos Stam's work on real-time stable fluids. He has a nice, simple system. Even has a version that runs on handheld computers (with no floating point math and no 3D graphics card). The OpenGL "Superflow" demo that nVidia provides with their Cg Browser is based on Stam's code. And the code is provided.

This simulator isn't set up as is to do explosion type fluids, but can do smoke in a room reasonably well. And with some hacks you might be able to do fire with it.

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.

[edited by - grhodes_at_work on October 9, 2003 1:44:56 PM]
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
Thank you all for your interest.

It was just inspiration and reading material directions I needed.

I will start out by collecting the papers right now!!!

THANX!!!
There''s a good paper on the nVidia developers site ( from GDCE I think ) about proceduarly generating volumetric explosions. It seemed pretty good...

You have to remember that you''re unique, just like everybody else.
If at first you don't succeed, redefine success.
I have studied Jos Stam''s sourcecode for the paper "Real-time fluid dynamics for games"

My ambition is to find a way to use the velocity field that the algorithm in the paper describes. It is too heavy to implement the whole algorithm in realtime, I think.

Instead I think, that if I only iterate the algorithem N times, and use the velocity field to move random particles in the enviroment.

This wont give exactly the fluid effect, but it will enable me to move "burning" particles round in the enviroment while preventing them to fly through solid objects.

Moving the particles will then only be a matter vector addition, and therefore I perhaps could implement it in a Cg program.

What do you think?
All the visible effects of an explosion stem from its shock wave, i.e., a supersonic wave front of extremely high pressure, density, and temperature. Clearly this is *compressible* flow. You''ll have a hard time modeling this using CFD methods for incompressible flow.

If you''re comfortable with fluid dynamics and numerical methods, take a look at the Siggraph 2000 paper on animating explosions for inspiration (though be warned it''s a long, long journey from the paper to a working implementation). If not, a simple hack is to model a shock wave procedurally (spherical wave front) that triggers acceleration of particles, rigid bodies, etc. (which then undergo dynamic simulation with collisions) as well as canned destruction effects (animations, decals, and so forth).
I have been studying Jos Stam's paper "Real-time fluid dynamics for games" and little by little I begin to understand his code.

http://www.dgp.utoronto.ca/people/stam/reality/Research/pub.html
Paper: "Real-Time Fluid Dynamics for Games"

I have no prior experience in CFD

My ambition is to create myself a 3D implementation, of Jos code, to play with. In the paper that it says : "Extending the solver to three dimensions should be straightforward to anyone who understands our code." If anyone has done that I would like to discuss the way it is done.

I know it is ambitious, to get voxel based CFD working in realtime games, but I want to examine if it is possible to simplify parts of it and make use of it in realtiem games.

A huge benefit of the method is that I after only a few iterations of the method get a vector field i can use to move particles without colliding with the walls!? Its not physically correct, but I think it can be tweaked into something usefull.

As mentioned in a previous comment: Modelling explosions involve compressible CFD. But I feel anyway, that it might be worth to examine incompressible CFD for use with explosions. Anyways i think it is a good introduction to CFD.

To make it run in realtime there are several problems that I have to face. Feel free to suggest other problems/soultions

1) Voxel representations are huge.

As far as i can see in Jos code each voxel only "communicates" with its neighbours. Therefore I think it would be usefull to compress the voxels and unpack subparts of it when working on it. Does it sound stupid? -And do anyone know any obvious methods for that.

I guess that my memory limit will be ~1MB. By avoiding floating point variables (Jos mentions in his paper that it is possible.) I can represent each voxel in ~16 bytes. That will allow a 3D voxel with a sidelenghth ~40.

I have thourght about working with a sort of tree dividing the voxelspace 8 times at each level. And only subdividing into small voxels at the outer edges of an explosion. Would it be possible? Has anyone done that?

2) To make It work in a game, I also need a method to voxelize polygons fast. Perhaps a more simple model of the enviroment will be nescesary?

Any comments ideas are very welcome!

Jos code is implemented in pure C, which makes it a bit tricky to understand. It has taken me alot of time untill now to just unwrapping the code. Now I am stuck at the point in the code where it says that it solves a Poisson to maintain incompressibility?

In the sourcecode provided by Jos Stam I am having trouble converting the function project() from 2D to 3D. How is that done?

Has anyone experience with this?

I know this was alot of brainstorming, and YOU must be very patient to be reading this. But I am a newbie in this area and therefore i appreciate comments and Ideas very much.

Thanx!


[edited by - TAX on October 16, 2003 6:19:14 AM]

[edited by - TAX on October 16, 2003 6:20:02 AM]

[edited by - TAX on October 16, 2003 6:22:27 AM]

[edited by - TAX on October 16, 2003 7:25:52 AM]

[edited by - TAX on October 16, 2003 9:16:49 AM]

[edited by - TAX on October 16, 2003 9:23:39 AM]

This topic is closed to new replies.

Advertisement