27 June 2010

Explosion Test 2 / Explinations

So I got a few tips from CG Talk that I'd like to talk about here. More or less talk about the entire explosion technique, or at least my understanding of it.

Fluids run on 4 basic grids: Density, Velocity, Temperature, and Fuel. Density is pretty straight forward so we will start there. Density is basically where you "see" a fluid. At least this is the default way of viewing the fluid shader. Where there is density there is fluid. Velocity is how the grid values are pushed around. Temperature and Fuel are a little more tricky to define in layman's terms. Temperature can be thought of as similar to density. It has most of the same attributes. But think of it as another layer of density that can add velocity vectors to the fluid and add another level of shading: eg incandesce. Temperature is also linked to fuel. Fuel is emitted the same way as temperature and density. Fuel, however, reacts to temperature, converting fuel values into temperature values.

So now that you have a little bit of back ground. I can talk about how my set up works. By the way, that paragraph condenses 6 months of research. So if you're still feeling lost on fluids do yourself a favor and read the flippin documentation in Maya. Then come back. This will make more sense. It will also make more sense if you also do some fluid testing of your own to get a handle on how it all works.

Now my explosion works with 2 emitters and one fluid. The emitters emit fluid values into the grid for about 8 frames then stop. There is a reason why I'm using two of them. One is emitter positive values and the other is emitting negative values. Both emitters also have emission turbulence, one is positive the other negative (inverted if you will). I learned about this from watching and reading some of David Schoneveld's posts. You can see the effect in action here. Anyway this give a nice break up of the fluid emission, the idea is to make sure it doesn't look like a prefect round blob of fluid during the first few frames.

An essential part of an explosion sim is having large emission values. As in emission values over "1". Mine are set to values ranging from 4-10. Just play around with them till you get something you like.

I say play with the values and I mean it. It's very easy to pick them and keep them because it's your little explosion and you like it and want to keep it. But you need to get used to the idea of changing lots of settings and running the sim many, many times. This is why it's good to keep things at a low resolution durning this stage. Now if you are new to fluids "low res" may not mean much to you. So I'll spell it out. My fluid container has a size of 20x40x20 and a resolution of 40x80x40. I feel anything lower than this won't be accurate enough to sim and anything higher will probably be wasting your time. So try to keep your res at about twice your container size. This will sim a lot faster than container that has 4 times or 8 times the resolution.

I think the next important factor is detail. You may notice that your sims tend to look blobby. So lets mix that up. There are several ways to make a fluid behave more erratically. Velocity has a nice swirl function, and there is a built in turbulence function as well, but both of these will tend to break up the fluid after 50 frames or so. Temperature has a turbulence setting. It's the only setting that makes it different from density. This will push the temperature values around the grid in a random fashion, but since the temperature should be dissipating rather quickly this turbulence won't be affecting the sim later. So it's how I add the detail in. Don't be afraid to really crank this value.

Fuel plays a big part in this sim. Now if you're like me you probably started out not knowing what the heck fuel is even useful for. Fuel creates temperature; so what I can emit that you say. And you are right. But by playing with the ignition temperature and the reaction speed you can affect the shape of the temperature. In other works you can keep emitter temperature in places the emitter is not present. Say in the cloud of rising smoke that happens to by carrying the burning fuel. To visualise this you will need to view the fuel values by themselves. Bet you always wondered why you would want to view the fluid in any mode other than "full render". You will see you fluid as just fuel, the fuel will start out full and then burn up. Depending on your settings the fuel may all burn up in the first few frames. You want the fuel to rise and burn and be completely spend with in the first half second or so. This is the trick to getting those gasoline like movie explosions.

The last thing I want to talk about is key framing. Some people seem to do this and others do not. Some people prefer to let the sim do its thing. I prefer to keyframe some of the values to make the sim do things. One value I key is the buoyancy. I start with some high values then key in some low values part way through the sim. The makes the fluid rise quickly in the first few frames but allows it to rise gently for the last part of the sim. It's a bit stylized but I think it adds a good look. You can key just about any value. So I'd start looking at values the work at different times in the sim and key them on when they are needed.

Anyway that's my research in a nutshell. I hope this helps. Here is my 2nd explosion test. It is a resolution of 250x400x250 and uses the principles mentioned above.

Explosion Test 2 from Calibrix on Vimeo.

No comments:

Post a Comment