Temitope FALADE's profile

HOUDINI - VELLUM SIMULATION (CLOTH BASICS)

HOUDINI - VELLUM SIMULATION
(CLOTH BASICS)
INTRODUCTION
Vellum simulation in Houdini has so many applications, ranging from cloth simulations, hair simulations, soft bodies, rigid bodies, and even particles.

In this module, we are going to get introduced into the vellum solver starting with cloth simulations. Then in later modules, we will explore the other application areas of vellum simulation.
BASIC CLOTH SETUP
Let's learn how to set up a very basic cloth simulation.

Let us begin by creating a geometry node and rename it "cloth", then double click to go into it's SOP level.

Let's create a grid geometry, move it up and increase the number of subdivisions on it. Let's also use a copy node to duplicate the grid into four.
Let's add a collision object. Create a test shader ball geometry and scale it up.
To convert the grid geometries into clothes, let's create a vellum configure cloth node. This node is a built-in cloth preset in Houdini and it will give us a realistic cloth result.

We will connect the output from the grid into the geometry input of this cloth node.
To add the collider object, let's connect the output from the test shader ball geometry into the collision geometry input of the cloth node.
Finally, to simulate the cloth, we will add a vellum solver node. This node is the brain behind all vellum simulations.
On the vellum solver node, let's enable the ground plane so that the clothes can collide with the ground as well.
If you play the simulation now, the clothes fall and collide with the shader ball. The result looks like below:
The clothes are sliding too much right now, so let's change some settings. On the vellum solver node, we will increase the friction.
On the vellum cloth node, we will reduce the bend stiffness so that the clothes fold more naturally.
Finally, let's connect a vellum post process node after the vellum solver to add more subdivisions to the cloth for better look.
Now if we play again, we get a much better result.
This is the most basic setup for cloth simulation inside Houdini.
VOLUME OBJECT CLOTH SIMULATION
As usual, let us start with a geometry node renamed as "cloth simulation" and dive into it's SOP level. Here, let's create a torus geometry and increase it's subdivisions.

We are going to convert this torus into a cloth that will fall down. So let's move it up a bit.
If we right click and type "vellum", we will see all the different vellum nodes available inside Houdini.  We can only access these tools in the SOP level of any geometry or dopnet node.

The ones with the "configure" to their names are already pre-configured in the Houdini engine and ready to fly, for example "vellum configure balloon", "vellum configure cloth", "vellum configure hair" etc.

Let's start with the very basic "vellum constraint" node and use it to create cloth; 

Create the vellum constraint node, and connect the torus to it's geometry input like shown below. This is going to create the constraint wireframes on the torus, converting it into a vellum object.
Notice there are three inputs on the vellum constraint node;

* The first input is going to convert any connected geometry into the vellum object;

* The second input is used for creating constraints which determines how the geometry behaves (for example, a pressure constraint on the surface of a balloon that makes it maintain it's volume or to create a jiggle effect on a softbody object);

* The third input is where we connect a collision geometry.

You can also create and use multiple vellum constraints node to define different properties or attributes of the vellum geometry by changing their constraint type in the constraint type dropdown each time we create a new one. The different constraint types have different parameters.

For example, if we create the "vellum configure balloon" node, we will see that two vellum constraint nodes have been connected together and each nodes do different things; the first one was used to convert the geometry into cloth (constraint type set to cloth) and the second one was used to define the pressure attribute (constraint type set to pressure).
TURNING THE TORUS INTO CLOTH
Let's change the constraint type on the vellum constraint node to 'cloth'. This will convert it into cloth.

As we know, to make any simulation work in Houdini, we need to connect a corresponding solver node, and in this case, a vellum solver node. 

NB: In pop simulation, we needed a pop solver; In flip simulation, we needed a flip solver; In whitewater simulation, we needed a whitewater solver; And so, in Vellum simulation, we will need a vellum solver node.

Once connected, and we play the simulation, the torus is going to fall under gravity force which is already pre-built into the vellum solver node (no need to create a gravity force node).

We can also add a collider geometry to the collider input of the vellum constraint. Let's create a grid, connect an output null, and plug it into the vellum constraint collider input. (We can also use the built-in ground plane collider on the vellum solver node in the collision section).

If we play again, the torus will fall and land on the grid as expected.
We can play around with the various parameters on the vellum constraint node to get different behaviour for the cloth. 

For example, increasing the Stretch Damping Ratio will make the cloth settle faster, and reducing it will make the cloth jiggle a couple of times before settling.

Increasing the Stretch Stiffness will make the cloth more stiff and stretch less, and reducing it will make it less stiff and stretch more; and so on.

TIP: To create a proper cloth simulation, our mesh should be not have any volume, that is, it must be single sided.
INFLATING THE TORUS
Let's create an effect whereby the torus inflates after hitting the grid. 

Let's first create a new transform node to flatten the torus; and then a blendshape node between the original shape and the flattened shape; we will connect it as shown below.

Quick Tip: Type $CEX, $CEY, and $CEZ into the Pivot Translate axes of the transform node to centralize the pivot on the geometry.
On the blendshape node, if we drag the blend slider front and back, we will see the torus changing form from flat to fully inflated.
Next, to integrate the inflating into the simulation, let's first determine what frame the torus hits the grid (in our case, the torus hits the grid at frame 25, so let's inflate it from say frame 40). Then we will set keyframe animation on the blendshape blend parameter from 0 to 1 at frames 40 - 54.

Right now, nothing will happen if we play the simulation. To make this work, let's first connect an output null to the blendshape node.

Now let's double click on the vellum solver node to dive into it. We are going to apply this inflation force into the force output as a vellum rest blend. Let's create a vellum rest blend node. This node is similar to the blendshape, but this one works in the solver level. It is going to blend between the original shape (flattened) of the torus geometry and the inflated shape at simulation runtime.
Let's perform the following settings on the vellum rest blend node (to ensure that it works with our blendshape node, we choose a SOP source and link-in the null output of the blendshape node):
To access the Constraint Group flag, let's go back to the SOP level and connect an output null to the output of the constraint geometry of the vellum constraint node to access it's corresponding attributes.

Next, let's turn on the output groups on the Stretch and Bend parameters.
Then let's go back into the vellum solver internal level and choose both the 'bend' and 'stretch' in the constraint group dropdown.
Then again on the vellum constraint node, let's increase the Bend Stiffness to a high value of about 0.5 x 1, and increase the Stretch Damping Ratio to a higher value of about 0.1

Also, let's change the vellum solver max. acceleration from 30 to 100 under the advanced tab;
Now if we play the simulation, we will see the torus inflates as expected.
ANOTHER METHOD TO INFLATE
Let's look at another method we can use to inflate an airtight mesh like a balloon. 

So let's quickly create a sphere polygon, and increase it's subdivisions.

Next, we will add a vellum configure balloon node. This node automatically connects a vellum cloth and a vellum pressure node for us.

Finally, let's connect them to a vellum solver. Our connections should look as follows:
On the vellum cloth node, let's reduce the stretch stiffness to 6 so that the sphere can stretch out more. 
On the vellum pressure node, let us enable the output group and rename it as "pressure group". We will not touch any other settings.

Next, let's double click the vellum solver node to enter it's DOP level.

Then let's create a vellum constraint property node (which is used for overriding the settings on the vellum constraint nodes. We will learn more about this node later on).
On the vellum constraint property, let's enable the 'group' field, and select the "pressure group".

Let's also enable the 'rest length scale' (which is used for scaling up or down the distance between two points in the vellum cloth; increasing this value will cause the distance between two points to increase, thereby expanding the cloth, and decreasing it will cause the distance to reduce, shrinking the cloth). We will animate this parameter over the timeline from 0 to 1.

If we play the simulation now, the sphere inflates! This method is much easier than the method we explored above.
If we place the sphere inside a bigger sphere and make the bigger sphere a collider, the small sphere will inflate to fill the volume of the bigger sphere.

If we add multiple smaller spheres within the bigger sphere, we can create a cool effect like something below:

ADDING CUSTOM FORCES TO CLOTH
Just like in particles, we can add local forces to affect the behaviour of clothes in Houdini.

To demonstrate this, let's create a grid and convert it into a cloth by doing the basic vellum cloth setup like below:
If we double click on the vellum solver, we can go into it's inputs. We will see that there are two output nodes; a force and a source output nodes.
We should know that particle forces can also affect vellum clothes because cloth behaves like connected particles. So if we create a pop force node for example and connect it to the force and source nodes, we can use it to add local force on the cloth object just like we do with particles.

To see the effect of the force, let's set the gravity on the vellum solver to zero, and then increase the amplitude on the pop force. If we play the simulation, the cloth will deform due to the pop force.
Let's add another local force. Create a pop axis force node. This force node will make the cloth deform about an axis. To create a twisting effect on the cloth, set the axis direction to y. Also adjust the radius to control how far along the mesh the twisting force would be applied. Then in the speed tab, let's increase the orbital speed.

If we play the simulation, the mesh would be twisted as shown below:
We can also combine multiple forces to create some complex deformation on the cloth. Let's use a merge node to combine the pop force and pop axis force as follows:
We get the following result:
CACHING THE CLOTH
The vellum has it's own caching node called vellum I/O. This node basically caches all the three outputs of the vellum solver.
As we can see below, it's settings are pretty much the same as the usual file cache node, except that we can choose the type of storage we want.
Moreso, if we intend to render inside Houdini, we can add a vellum post processing node to do some post process modifications. For instance, when we sim a single-sided cloth and we want to give it a thickness after, we can use this node to add the thickness by checking on the "extrude by thickness" parameter. We can also use it to fix collision issues in the simulation; add more subdivisions to the mesh etc.
We can also cache the cloth simulation in the same way we cache out every other simulations in Houdini. Connect a file output node to the vellum solver, choose output directory, and cache it out as a 'bgeo.sc' format.

To export as alembic, we simply connect an rop alembic output and export as alembic. The alembic can now be imported into Maya to render.
We have the following playblast preview of the simulation in Maya:
CHARACTER CLOTH SIMULATION
Having learnt the basics of vellum simulation, let us examine how to simulate cloth on an animated character inside Houdini.

We will start the process by first creating the cloth for the character using Marvelous Designers. Then after creating the cloth, we will import it into Houdini, as well as the alembic of the character animation, and then we will setup the cloth to simulate naturally and also look at how to constrain parts of the cloth to the character so that it behaves how we need it to. So let's dive right into it:
Import the Animation Alembic
Let's start by importing the animation into Houdini as alembic geometry. 

Create a new geometry node and name it "cloth simulation" and dive into it's SOP level. Then create an alembic node to import the animation.

If we playback, the animation should play in the viewport.
Create the Cloth in Marvelous Designers (or anywhere else)!
Next, let's create the cloth using marvelous designers (you can also create it anywhere else).

The cloth geometry was exported as an FBX model.
Importing Cloth Assets into Houdini
Let's create a file node and use it to import the cloth geometry into Houdini. Now let's clean things up.

The first issue we will address is the UV patterns on the character, it is a bit distracting.
Let's use an attribute delete node to delete the UV attributes in the vertex attributes. The uv seam would be removed. Let's also add a color node to give a basic shading to the character (if we want to use a texture map, we will use the attribute from map node instead).
Let's also add a color node to the cloth to shade it and let's merge the cloth and the character together so that we can preview everything at once. 

We see that everything matches already, this is because we first exported the cloth from marvelous designers to Maya, and inside Maya, we scaled the cloth to fit the character before exporting it again to Houdini.

Also, like we mentioned in the previous section, in order to simulate clothes, we need them to be single-sided (that is, no thickness) as this works best with the vellum solver.
Next thing we have to ensure is that all the vertices on the cloth geometry are welded together into a single object. If we exported from Marvelous Designers as multiple objects, we need to weld them back inside Houdini using the fuse node. This is actually the best way to export in order to keep the UVs of the cloth pieces intact. 

For the sake of this learning however, we choose to export as a single object with the weld option enabled so we won't have to weld them again inside Houdini.

We also decided to separate the top and the skirt into two separate geometries as we can see in the node setup above so that we can easily control the simulation parameters for each of them separately.

TIP: If we want to attach part of the cloth to another geometry, we need to select the points on the cloth that we want to attach, and create a group out of those points so that we can reference them later in the vellum simulation when setting up constraints.
Let's create a constrain group on the skirt. We want to do this because we want to attach the skirt to the character later in the simulation. So in the skirt node setups, let's create a group node and connect it as follows:
Let's give the group the name "skirt constraint GRP" and change the group type to 'points'. In the Base Group field, if we click the arrow next to the dropdown button, it will allow us to select the points on the skirt that we want to add to this group.
So in the viewport, we will select the points on the skirt that we want to attach to the character during the simulation (this is similar to creating selection sets inside Maya). When we are done with the selection, keep the mouse arrow in the viewport and press the ENTER button on the keyboard. This will now add the selected points to the group, and we will see that because the point numbers would now be added into the 'Base Group' field.
Using the same method, we created a constraint group for some points on the shoulder region of the top cloth.

Later on, we can reference these groups to constrain the cloth to the character (similar to point to surface constraint in Maya nCloth).
Simulate the Cloth
Let's create a new vellum configure cloth and a vellum solver and connect them as follows:
With this basic setup, if we play the simulation, the clothes will fall straight down. Let's make it collide with the character by connecting the character null output into the vellum constraint collider input.
The cloth simulation works!
Adding Constraints
We noticed a couple of issue in the simulation. Firstly, the top is slipping off from the shoulder area. Also we notice the skirt is also slipping down the character's waist. Lastly, the cloth bounces too much and doesn't move realistically.

To fix the cloth slipping off issues, we are going to create new vellum constraint nodes, one for each parts we want to constrain.
We will change the constraint type on each constraint nodes to 'attach to geometry'.
By default, this will attach all the points on the cloth to the character. So we will choose the corresponding points groups we created earlier for each nodes.
TIP: If we want to stitch points on one cloth piece to another cloth piece, we will use the 'stitch points' constraint type instead (similar to Component to Component constraint in Maya nCloth).

Then we can select the point group on the first cloth piece under the Geometry tab, and the target cloth piece's point group (in this case, we will put * inside the target group to tell Houdini to use all the points on the target cloth; Houdini will stitch the first cloth piece's points to the nearest points on the target cloth piece as long as we check on the 'constrain to closest point') under the Target Geometry tab.
So if we play now, the cloth should now sit properly on the character without slipping off like before.
Multilayer Cloth Setup
The method we have explored so far combines both top and skirt under one single vellum cloth node. The issue with setting things up this way is that whatever settings we perform on the vellum cloth node is going to affect both the top and the skirt together. This can give some unwanted results. So the best way to get the top to behave separately than the skirt is to separate their vellum cloth nodes. This way, we can also address the issues with the cloth stretching and bending.
We are going to change the node setup that we have done before.

Let's duplicate the existing vellum node cloth and use it for the skirt while keeping the original one for the top (or we can also create a new one from scratch).
On the top cloth node, let's perform the following settings:
On the skirt cloth node, let's perform the following settings:
Now that we have two separate vellum cloth nodes with three outputs, how do we merge them back into our vellum solver? For this purpose, we will create a vellum pack node for each cloth piece's vellum cloth nodes, and use a merge node to combine them.

Then to connect them to the vellum solver, we will first use a vellum unpack node to unpack them before connecting to the vellum solver. 

We will also separate the constraints for each cloth pieces.

Also, we will now connect the collider directly to the vellum solver node.

The connections should look as follows:
This method shown above is how we can create multiple layers of clothes with their different vellum cloth nodes.
Also, to improve the simulation, let's perform the following settings on the vellum solver:
Let's add a vellum I/O node to cache the simulation, and a vellum post process node to add more subdivisions and thickness to the cloth.

Finally, let's add an rop alembic output node to cache it to alembic so that we can render in Maya.
Here's a preview of the playblast in Maya:
CLOTH LOOK DEVELOPMENT
The look of a cloth is how the cloth material behaves. For example, we can create a cloth that behaves like a silk, or denim, or leather, or velvet etc. 

To create these looks, we need to tweak the vellum cloth settings.

Here's a useful link where you can find different settings to create different looks for the cloths:
https://www.sidefx.com/tutorials/h17-vellum-cloth-lookdev-tips/
HOUDINI - VELLUM SIMULATION (CLOTH BASICS)
Published:

Owner

HOUDINI - VELLUM SIMULATION (CLOTH BASICS)

Published: