Ever wonder what CHOPs are used for? Here we're using it to make a buoy of everyone's favorite Rubber Toy!
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.
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.
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.
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.
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!
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.
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.
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:
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 :)
Comments