Creating particles from scratch in DOP

One of the cool new features of Houdini 13 is having particles in the dynamics context. Of course, Houdini has various nodes to handle particles. But how does it all work? In this post, I’ll explore how to create a very simple particle system in DOP from scratch.

Source Geometry

First of all, we’ll create an object to generate particles from. Let’s create a sphere, scatter points on the sphere, and add velocity attribute that points away from the center of the sphere. The SOP chain will look something like:

2013_11_03_creating-particles-from-scratch-in-dop_1

To make the particles a little more interesting, we’ll set Random Seed to $T. And just so we can see the individual points in the viewport more clearly, we’ll just reduce Number Of Points to 10.

2013_11_03_creating-particles-from-scratch-in-dop_2

The Velocity attribute is set with the position of the sphere. This will give us velocities that initially point away from the center of the sphere.

2013_11_03_creating-particles-from-scratch-in-dop_3

Now, we should see some points being scattered around.

2013_11_03_creating-particles-from-scratch-in-dop_4

Create the DOP Network

Next, we’ll obviously need a DOP network. The most basic elements of a DOP simulation are objects and solvers. This is not specific to particles, and applies to any DOP simulation (RBD, fluid, FEM, etc.). So, let’s create a DOP Network. And inside it, we’ll create an Empty Object, and a Multiple Solver.

2013_11_03_creating-particles-from-scratch-in-dop_5

The Empty Object will create a bare simulation object (DOP Object) that will be used to simulate our particles inside this simulation. As we’ll soon see, in order to simulate our particles, we’ll need to make use of a few simple solvers. That’s why we need to attach our DOP Object to the Multiple Solver. The Multiple Solver allows us to combine a series of solvers together, and each solver will be processed one after the other.

Generate particles

At each timestep, we want to use the source object to add new particles to the DOP object. This can be done easily by a SOP solver. A SOP Solver contains a SOP network that will receive the DOP object’s geometry as input, and uses SOPs to generate the output geometry. The output geometry then becomes the new geometry of the DOP object. In our case, the input DOP geometry contains the existing points, and we want to add new points to it using the source geometry. This is very simple to do with SOPs. All we need to do is use Object Merge to bring the source geometry into the SOP network. Then, use a Merge to combine the source geometry points and the input DOP geometry.

First create a SOP Solver, and connect it to the Multiple Solver node.

2013_11_03_creating-particles-from-scratch-in-dop_6

Then, inside the SOP Solver, create a Object Merge.

2013_11_03_creating-particles-from-scratch-in-dop_7

And pick the source object.

2013_11_03_creating-particles-from-scratch-in-dop_8

Then, create a Merge node, and connect the DOP geometry and the Object Merge together.

2013_11_03_creating-particles-from-scratch-in-dop_9

And we’re done! If we play the simulation now, we’ll see particles being generated, but they’re not moving at all!

2013_11_03_creating-particles-from-scratch-in-dop_10

That’s because we don’t have a solver that moves the particles!

Moving the particles

The points do have velocity attribute, but we don’t yet have a solver that uses the velocity to move the points! This can be done with the Gas Integrator solver. The task is simple. Create the solver, and connect it into the Multiple Solver node.

2013_11_03_creating-particles-from-scratch-in-dop_11

Then, we need to set the Geometry parameter to “Geometry”, so that the solver will update the points from our geometry.

2013_11_03_creating-particles-from-scratch-in-dop_12

And now, if we play the simulation, we’ll see particles moving away from the center, according to the velocity!

2013_11_03_creating-particles-from-scratch-in-dop_13

Gravity

Next, let’s add a simple gravity force. We clearly need to use a Gravity Force node here, so let’s attach one to the DOP object.

2013_11_03_creating-particles-from-scratch-in-dop_14

If we play the simulation, we’ll notice that nothing has changed. This is because we don’t have a solver that takes forces into account and modifies the velocity. That’s exactly what the Gas External Forces solver will do. This solver will update the velocity of each point according to all the forces that are attached to the DOP object. So let’s create a Gas External Forces node, and connect it to our Multiple Solver node.

2013_11_03_creating-particles-from-scratch-in-dop_15

Then, we need to set the Geometry parameter to “Geometry”, so that the solver will update the points from our geometry.

2013_11_03_creating-particles-from-scratch-in-dop_16

If we play the simulation now, we’ll see that the particles are affected by gravity!

2013_11_03_creating-particles-from-scratch-in-dop_17

That’s it!

This is a simple DOP exercise to demonstrate how particles can are created in DOP. Normally, it’d make much more sense to use the packaged POP nodes that come with Houdini. The packaged particle nodes have much more functionality that are not covered in this post. Nonetheless, it’s very interesting to know what’s involved in creating particles from scratch in DOP.

1 thought on “Creating particles from scratch in DOP

Leave a comment