Over a million developers have joined DZone.

Simulating Accretion with Houdini's Grains Solver

DZone's Guide to

Simulating Accretion with Houdini's Grains Solver

Check out this example of using SideFX Houdini to simulate enough individual grains of sand to see accretion effects.

· Performance Zone ·
Free Resource

Container Monitoring and Management eBook: Read about the new realities of containerization.

When I started thinking about using SideFX Houdini to simulate accretion, I was expecting to have my VEX skills (or lack of) pushed to their limits. However, after looking at Houdini's grains solver, I was able to come up with quite a nice looking solution with only a handful of lines of VEX.

My first grains experiment (Experimenting with Impacts) created a solid block of sand from a box. But, there's no reason why the grain source needs to be a single piece of geometry. For this project, I created a disc (a flattened tube), created points from the disc's volume and copied small spheres to each point:

That disc-shaped array of spheres became my grain source:

Houdini grains can be manipulated with POP forces such as drag, vortex (axis) and attract. So my DOP network has a handful of these to give the orbiting effect with a single radial gravity at the center of the system:

The combination of upping the clumping values in the POP Grains node and adding an attractive POP Interact node pulls the individual grains towards each other. The POP Wrangle contains a few lines of VEX to squeeze the grains into the disc shape:

if (@P.y < -0.1) {
    @force.y += 50;
else if (@P.y > 0.1)  {
    @force.y -= 50;

The final step was to swap out the default sprite rendering used by the grains shelf tool for actual geometry. I found the end result from sprites was too flat: sprites don't cast shadows over each other. An icosahedron gave a nice look, so my grain particles geometry node ended up like this:

The particles were assigned the out-of-the box clay material and voilà, a few hours later, I was procedurally building proto-planets!

Because everything looks better with depth-of-field, here's another render:

The music (if you can call it that) was created by me using Garage Band.

Take the Chaos Out of Container Monitoring. View the webcast on-demand!

houdini ,simulation ,performance

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}