Gears of Washroom – Pt 3

Last post I talked about some of the RBD prep for the grenade explosions, now time to talk about Pyro and Flip prep!

Every Sim in its right place

All of the simulations (RBD, Pyro and FLIP) live in the same DOP network:

AutoDop_fluid
(Click on image to expand)

The network itself isn’t terribly exciting, it was mostly built using by testing out shelf tools in other files, then I’d reconstruct them to try and understand them a bit better. I might dive into it a little later in this blog series.

Now, on to the networks that feed this beast!

Explosion fuel and force

FuelAndForce
(Click on image to expand)

In this network, I’m importing the grenade geometry and using it as a basis for generating fuel for the Pyro simulation, and also forces that affect the FLIP and RBD sims.
Sorry about the sloppy naming and layout of this one, it’s not as readable as it should be.

Splodey time!

Early in the grenades network, I created a primitive attribute called “splodeyTime”, set about 10 frames apart for each grenade.
This attribute drives the timing of all of the explosion related effects.

For example, I use it to set the active time for the RBD pieces in an attribute wrangle:

if (@Frame > (@splodeyTime-2)) i@active = 1;

You can also see it in the first loop in my Explosion Fuel and Force network:

FuelAndForce_foreach1

Here, I’m doing some similar promotion tricks like in the last post:

  • Iterating over pieces (in this case each piece is a grenade base)
  • Promoting splodeyTime up to a detail attribute.
  • Creating a single new point in the centre of the current grenade, using the Add SOP:
    AddPoint
  • Deleting all geometry except for that point.
  • Also delete the point, if:
    • Current frame number < (splodeyTime – 2)
    • Current frame number > (splodeyTime + 2)

So at the end of the foreach, each grenade will be represented by a single point, that will only exist for 4 frames around the splodeyTime of that grenade.

Great metaballs of fire!

The first thing I do with those points, is generate a cigar of metaballs:

MetaballCigar
I’m using this rather dubious looking thing to break constraints on the RBD (in the Remove Broken SOP solver in the DOP network diagram at the top of the post).

There are two more branches that come off the metaball cigar.

MetaballAndPoints

The left branch just inflates each of the metaballs, it is fed into a Magnet Force, and is only used on the RBD objects, to blow the grenade fragments apart.

The right branch is very similar, except after a slightly more aggressive inflation, I’m generating points from the volume of the metaballs, and adding a velocity attribute to them.

The points, that you can see in the image, are used to drive force in the water that explodes out of the grenades, in the FLIP fluid.

One thing I wanted to do here was to have fluid that is near the wall shoot out pretty straight, but then add a bit more randomness when the fluid is near the chain end of the grenade.

Not the best way to visualize it, but these are the force vectors for that effect:

FluidForceVectors

To start out, I set the velocity attribute to {10,0,0} in an attribute wrangle.

Then, the randomness is achieved in the creatively named attribvop1 in the right branch a few images back, and here is what that looks like:

ForceVectorVOP.png

Stepping through this network a bit…
I’m creating a new noisey velocity, and mixing that with the existing straight down X velocity.

I always want the noisey velocity to be positive in X, but to be much stronger in Y and Z, hence the splitting out of the X component and the abs after the bottom noise.

The mix node uses the X position of the point to work out how much of the straight velocity to use versus the noisey velocity.
So between 0 – 5 in X, I’m blending the two. When the position is greater than 5, we have 100% of the noisey vector.

I messed about with lots of different vector / noise patterns, but I liked the movement this gave my fluid, so I stuck with this 🙂

Fuel

Backing up a bit, there’s one more branch of this network, and it creates the fuel for my Pyro simulation:

FuelNetwork

I’m copying a sphere onto the explosion points, and then using a fluid source SOP to create a volume for fuel, and using the built in noise settings to get some variation.

The sphere itself is getting scaled by splodeyTime, using copy stamping in uniform scale:

fit((stamp(“../copy2/”, “splodeyTime”, 1) – $F), -2, 2, 4, 10)

I also move it forward each frame using an attribute wrangle:

@P.x += ((@Frame+4) – @splodeyTime)*2;

This is what the fuel looks like over the few frames it is generated:

Fuel

Flipping glass

One last thing for simulation prep, I’m using the glass sections of the grenade as the fluid source of the exploding Flip sim.

Again, this uses the splodeyTime to delete the glass when it is outside of the frame range, so I’m creating the surface volume and particles just for a few frames:

FlipParticlesAndSurface

That’s pretty much each for simulation prep, at least for the main explosion!

Still to come, the bubbling water at the start, and all things materials and rendering.

One thought on “Gears of Washroom – Pt 3

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s