top of page
Writer's pictureColby Winfield

Houdini Ocean Bobbing and CHOPs

Ever wonder what CHOPs are used for? Here we're using it to make a buoy of everyone's favorite Rubber Toy!


Ocean bobbing using CHOPs

So how is this working exactly and what are we looking at?

This is a simple ocean_spectrum with an ocean_evaluate node, and a grid. Super simple.

For this to work properly, the "size" of the grid (10x10 default) needs to match "grid size" in the ocean_spectrum

The spectrum controls the look and feel of our ocean surface, and the evaluate deforms our grid for us.

The next step is to scatter a point on the grid. If we just scatter after the ocean_evaluate, our point will jitter every frame over the entire grid. So not exactly ideal. How do we solve this? Scatter on the original grid (non-deformed) first. Now we need to deform the point with the grid somehow.

Check Prim Num Attribute and Prim UVW Attribute

Nothing will look different, but we're storing the primitive and UV locations of where that point is scattered. Since the deformed ocean surface has the same point count as the incoming grid, we can use the source primitive and the source UV to update the position of the point where it should be on the ocean.


Scatter to input1, oceanavaluate into input2. Make sure to have point normals after oceanevaluate
Attribute should be P for the position output, and attribute needs to be N for the N output

Once we connect all this up, our point is now following along with the ocean surface, and inheriting the v@N normal attribute as well. Just to ensure we have smooth Normals, I'm transferring the normals here with an attribute_transfer and under "conditions" I'm setting the "Max Sample Count" to 80. This should average out our Normals, making the final result smoother.

Okay, but what about CHOPs? To be honest, we don't really need CHOPs here, but it adds a layer of complexity that visually helps seal the deal. So let's take a look at how to set that up.

Here I'm blending the N with a simple up vector. This helps reduce the jitter
Ensure "Method" is set to Animated

Drop a channel SOP down as well as a chopnet. The path above ("../chopnet1/OUT") doesn't yet exist, so let's dive into the new chopnet1 node we created and make it!

In "Geometry", point the SOP to our incoming null called IN_CHOPS we made on the SOP level (seen in previous photo)

Make sure the "Method" is set to Animated, and add a lag and filter node. Play around the settings to your liking. I also tend to use Jiggle and Delay from time to time as well.


Orange is incoming geometry, green is our processed animation

A result of the Delay and the Filter gives us the image above. The Filter is using a Gaussian filter to smooth out the animation, and the delay is simply offsetting the timing. I found it helps sell the animation more when it's offset and doesn't perfectly mimic the ocean animation, since in real life there would be a delay because... idk physics or something stupid like that.

Camera point on the right

You'll notice i do the same setup but with a different scatter seed for the "OUT_PT". This will drive a null on the /obj level that animates our camera for us. Let's take a look:

I'm just pointing to the point!

In the "Translate" parameter, I'm using the expression: point('../grid1/OUT_PT/',0,"P",0), point('../grid1/OUT_PT/',0,"P",1) and point('../grid1/OUT_PT/',0,"P",2) for each respective index of the Translate vector. This will now bob my camera up and down, but using a different point than our animation. This is important because if we used the same point as our animation, it would look very strange since in reality how could the camera be affected by the exact same point as the character? It wouldn't ever happen. In the chopnet for the camera, I just enabled the Jiggle deformer as well.


And wallah! We have an animated camera AND ocean AND character! Hope you learned something new today :)

Enjoy!

7 views0 comments

Comments


bottom of page