Node Nuggets 004 – Solver (Houdini) (Patreon)
Videos
-
clip01.mp4 -
clip02.mp4 -
clip03.mp4
Downloads
Content
A powerful but frequently misunderstood tool in Houdini is the Solver node (also sometimes known as SOP Solver). Solver enables cumulative effects that take into account the state of the previous frame of an animation.
This can be used for all sorts of interesting effects. Let’s look at a couple examples!
Say we want to transfer some information from one mesh to another. We can easily do this using an Attribute Transfer node. Here we have an animated red box and we’ll transfer its color (Cd) to a grid.
But wait a minute, this is only transferring the color in the current frame. The red isn’t building up on areas the box has already touched.
Solver to the rescue!
Attach one as shown, then dive inside.
Note there are four inputs matching the four inputs on the node, plus an input for Prev_Frame.
To transfer the box’s color and have it “stick,” perform the Attribute Transfer onto the previous frame. For fun I added an Attribute Blur to cumulatively blur the results (uncheck Pin Border Points to blur right up to the edge of the grid).
This produces a nice dissipation effect, as if the color is bleeding into an absorptive material.
Now let’s use a Solver to create a growth-style effect. Create a box with a few extra divisions and attach a Solver.
Dive inside and use a Labs Random Selection to select a single random polygon on the box. Add an Extrude node that operates on the randomly selected polygon. I added an HScript expression to the Distance parameter to randomize how far each extrusion extends.
The result is a shape that randomly grows outward as each new extrusion builds upon the previous frame.
Bonus tip: you can use Python to control Houdini parameters instead of the usual HScript. Here’s the same random distance expression written in Python instead!