[vimeo https://vimeo.com/101620918 w=560&h=315]

This simple RnD demonstrates the use of Rigid Body Dynamics, Computational Fluid Dynamics, Particle Dynamics and their interoperability all within Houdini DOPS.

RIGID BODY DYNAMICS:

My previous RBD simulations suffered from the debris pieces being perfectly flat and polygonal around their surfaces. After generating and caching my initial debris simulation, I then used the for-each SOP and the corresponding ‘name’ attribute to apply a bit of noise (Mountain SOP) and subdivision to the individual debris. This made them look a bit more rocky and less flat/polygonal.

SMALLER PEBBLES AND THE PEBBLE LIBRARY:

In order to add a bit more variation to the system, I decided to add smaller pebbles that get thrown off with the bigger debris pieces. To accomplish this, I again took the original debris simulation into a for-each SOP, scaled them down and then moved their centroids to the origin. With the use of the file SOP, I was able to cache about 20 variations to disk, suffixing them with ‘opdigits’, that is, pebble1, pebble2, pebble3…e.t.c.

These smaller pebbles were then brought back into the RBD simulation with a RBD Point object by adding an instance attribute onto a point cloud that followed a pattern similar to:

/obj/pebble_library/pebble`trunc(fit(rand($PT),0,1,1,21))`

The point cloud was generated by scattering some points in a region where I wanted as the initial position for the pebbles. Note that the total number of points scattered will result in the total number of pebbles in the system.

By bringing the pebbles back into the RBD simulation, the smaller pebbles could then collide properly with the bigger debris. The result of this was then cached to disk.

FLUID DYNAMICS: DUST SIMULATION AND THE PYRO SOLVER

The Pyro Solver in Houdini was used for the dust that get emitted with the debris. Note that this may also be achieved with the smoke solver, however, I always prefer using the pyro solver as it offers a lot more flexibility and controls that aids with the shape and character of smoke and fire simulations.

The source of the dust emitter were the debris pieces that only fell unto the ground surface. To isolate these pieces, I used an expression in the delete SOP that followed this pattern:

$TY<0.1

When the expression evaluates to true, it selects only the pieces that had fallen below 0.1 units. By deleting non-selected pieces, we can get rid of those pieces that aren’t falling to the ground. The desired pieces are then sent into the ‘fluid source’ SOP and the result is then cached to disk for a faster feedback.

To make the pyro solver give me results that resembled that of dust, I had to pump in just a tiny bit of viscosity and bring down the turbulence significantly. I must mention that the desired look is always relative based on an individual and how they want their art to be directed.

I also had to key frame the buoyancy just so the smoke begins to rise only when they have hit the ground surface. I can assure you that there are definitely a lot of controls to play with on the pyro solver in order to achieve different aesthetics. The result of the pyro simulation is then also cached to disk.

RBD / FLUID COLLISIONS:

In order to further aid the realism, it is imperative for the rigid body elements to collide properly with the emitted smoke. I know of two ways of achieving this interaction, I however went for the simplest/faster approach.

A much more precise approach is to generate a collision field from the debris and then plug this into the pyro solver. In my case, I simply used a merge DOP, and I set its collision property to ‘mutual’.

PARTICLE DYNAMICS:

I also wanted to generate some grit particles that may be interpreted as sand. The first approach that came to mind was to scatter some points at the expected initial position of the sand particles and extract the ‘vel’ attribute from my dust simulation and then apply it unto the particles for advection.

While that is a totally valid approach, I decided to rather take advantage of the POPS/DOPS interaction that has been introduced in recent versions of Houdini using the POP object. It was quite straight forward. I emitted some particles off the RBD debris, inherited a part of the debris velocity and I applied some gravity. This made the particles move downward and in the direction of the falling debris pieces.

PARTICLES/RBD COLLISIONS:

I required the particles to collide properly with the debris as well as the ground plane but simply merging the particle stream into the rigid body stream alone didn’t cut it. Two problems arose with this approach:

* The particles collided well with the ground plane but kept on sliding
* The particle velocity was affected by the debris velocity and/or vice-versa depending on what the merge relationship was set to.

This caused the partcles/debris to explode.

To fix the first problem, I set the static friction value for the particles to about 2 on the pop object and this put the particles to rest the moment they collided with the ground.

The other problem was fixed by using 3 merge DOPS:
merge 1 : particle -> ground plane : collide relationship = mutual
merge 2 : debris -> ground plane: collide relationship = mutual
merge 3: merge1 -> merge2: collide relationship = No change

This obviously is not the best approach as it might mean that the particles would not collide well with the debris but then, who in the world wants to deal with rebellious particles that are out of control?

Advertisements