Houdini Tutorial Week 3

This week we will be attempting to make a destruction effect, and I will be using the wooden house model I made in the first week for a destructive test.

First, we need to understand [Voronoi].

[Voronoi] is sort of the closest thing we found to use to do a bit sort of natural or shapes of destruction. The way it works is basically we scatter a lot of points and then between each two points we draw a line and the line stops where there’s another line between other points. This effect is what we wanted to achieve in the 3D shattering process. The irregularity of the shattering will give a more realistic texture to the effects.

Definition of [Voronoi]:

In mathematics, a Voronoi diagram is a special kind of decomposition of a metric space determined by distances to a specified discrete set of objects in the space, e.g., by a discrete set of points. It is named after Georgy Voronoi, also called a Voronoi tessellation, a Voronoi decomposition, a Dirichlet tessellation (after Lejeune Dirichlet), or a Thiessen Polygon.

In the simplest case, we are given a set of points S in the plane, which are the Voronoi sites. Each site s has a Voronoi cell, also called a Dirichlet cell, V(s) consisting of all points closer to s than to any other site. The segments of the Voronoi diagram are all the points in the plane that are equidistant to the two nearest sites. The Voronoi nodes are the points equidistant to three (or more) sites.

History of [Voronoi]:

Informal use of Voronoi diagrams can be traced back to Descartes in 1644. Dirichlet used 2-dimensional and 3-dimensional Voronoi diagrams in his study of quadratic forms in 1850. British physician John Snow used a Voronoi diagram in 1854 to illustrate how the majority of people who died in the Soho cholera epidemic lived closer to the infected Broad Street pump than to any other water pump.

Voronoi diagrams are named after Russian mathematician Georgy Fedoseevich Voronoi (or Voronoy) who defined and studied the general n-dimensional case in 1908. Voronoi diagrams that are used in geophysics and meteorology to analyse spatially distributed data (such as rainfall measurements) are called Thiessen polygons after American meteorologist Alfred H. Thiessen. In condensed matter physics, such tessellations are also known as Wigner-Seitz unit cells. Voronoi tessellations of the reciprocal lattice of momenta are called Brillouin zones. For general lattices in Lie groups, the cells are simply called fundamental domains. In the case of general metric spaces, the cells are often called metric fundamental polygons.

The first way of breaking:

First, create an [sphere] in the [Geometry] screen. Set the [Primitive Type] to [Polygon] mode. Then set the [Frequency] value to 10.

Create [scatter]. Note that [scatter] should be unchecked by [Relax Iterationtions] so that the surface of our model will have an irregular [voronoifracture] shape in the next step. Create [voronoifracture], which is a new node. This will help us create a [voronoifracture] shape on our model’s surface based on the points in [scatter].

Add the [explodedview] node. With the help of this node, we can observe the irregular fragmentation effect of the current model under the action of the [explodedview] node.

If you want to change the number of broken objects or how much they spread after breaking, we can do this later. The [Force Total Count] value of the [scatter] node controls the number of objects that break. I feel that the principle is based on adding points to the original object. As the points increase on the object’s surface, the number of broken objects increases according to [voronoifracture].

The value of [Uniform Scale] in the [Explodedview] node controls the state (distance) of the object after it has been broken.

Creating [pointsfromvolume] allows you to observe the points of the model. The value of [Jitter Scale] in [pointsfromvolume] can reverse the broken model.

Add the [Merge] node. Adjust some more node parameters (to control the number and shape of broken models).

Create the [vdbfrompolygons] node.

This node can create a distance field (signed (SDF) or unsigned) and/or a density (fog) field.

When you create a fog field you can choose to fill the band of voxels on the surface or (if you have an airtight surface) fill the surface (see the Fill interior parameter). Since VDB primitives only store the voxels around the surface, they can have a much higher effective resolution than creating a traditional volume with IsoOffset. You can connect a VDB to the second input to automatically use that VDB’s orientation and voxel size (see the Reference VDB parameter).

When we uncheck [Distance VDB] in [vdbfrompolygons] and then select [Fog VDB], the state of the model will change.

Create the [isooffset] node. Connect the [isooffset] node directly to the [sphere] node. At this point, you can observe the change in the shape of the object.

The IsoOffset operation builds an implicit function given the input geometry. It then uses the implicit function to create a shell at a fixed offset from the original surface. The tetrahedral mesh mode may be used to create a uniformly sampled array of tetrahedrons for use in simulations. The volume output modes allow the implicit function to be output directly as a volume primitive without further processing.

At this point we delete the [isooffset] node. Under the [vdbfrompolygons] node connect [scatter]. Cancel [Relax Iterations] in [scatter], so that randomly distributed points will appear. Then cancel [merge] to connect the [pointsfromvolume] line. Connect the [scatter] under the [vdbfrompolygons] node to [merge]. Adjust the value of [Force Total Count] in [scatter] under the [vdbfrompolygons] node to adjust the number of broken objects.

Add [remesh] node.

【remesh】:

This node tries to maximize the smallest angle in each triangle. (A “high quality” triangle mesh is one where all angles are as close as possible to 60 degrees.)

This node does two types of remeshing:

Uniform

The node tries to equalize all edge lengths, giving triangles of equal size.

Adaptive

The node uses bigger triangles in broad areas and smaller triangles in detailed areas. This uses allows you to represent the original surface with fewer triangles. However, since edge lengths vary, this mode will have fewer equilateral triangles than Uniform.

Add the [noise] node to adjust the shape of the base model of the object. This will also give the final result a more curved image.

Create [rest] and [attribwrangle] nodes.

【rest】:

This node creates an attribute which causes material textures to stick to surfaces deformed using other operations.

Rest can get the rest position in one of two ways:

1.By reading a file.

2.By attaching a second input.

The first input is the deforming geometry. The second input (or file) is the rest position data, which is typically a static, non-deforming surface. If no second input or rest file is provided the first input will be used for the rest values. This is useful when the rest SOP is used before deformation in the pipeline.

The topologies of the two geometries should match.

All primitives support the ‘rest’ attribute, but, in the case of quadric primitives (circle, tube, sphere and metaball primitives), the rest position is only translational. This means that rest normals will not work correctly for these primitive types either.

The ‘rest’ attribute is exported to RenderMan as the ‘Pr’ attribute. This is output for all surfaces as a ‘vertex float attribute’.

Rest normals are required if feathering is used on polygons and meshes in Mantra. NURBs/Beziers will use the rest position to compute the correct resting normals.

[attribwrangle]:

Final node diagram for the first crushing method:

Select [Piece Prefix] in the [voronoifracture] node. It’s showing us all the polygons that have the same name or the other of the primitives.

The second type of fragmentation:

Add [scatter] to the original nodes (the value of [Force Total Count] is turned down), add [grid] and [copytopoints].

[grid]:

The plane can be a mesh, Bezier and NURBS surfaces, or multiple lines using open polygons.

[copytopoints]:

Add [attribrandomize] node, (remember to change the attribute in [Distribution] to [Direction or Orientation].)

[attribrandomize]:

This node generates random values to create or modify an attribute.

Turn on the Visualize as Points toggle to preview the probability distribution as a generated point cloud whose positions are drawn from the distribution.

At this point, we need to increase the [size] value of [grid]. This will also make the broken plane of the object larger.

Add [booleanfracture] and [explodedview]. This will form the shape of the model after a fracture.

[booleanfracture]:

This SOP fractures the input mesh using one or more cutting surfaces. Similar to Voronoi Fracture, this is a higher-level node (based on the Boolean SOP) that handles common fracturing-related tasks such as naming pieces, recomputing normals, and building constraints between adjacent pieces.

[explodedview]:

This operation pushes selected geometry out from the center. It does so piece-by-piece to create an exploded view of the geometry. This can be very useful in visualizing how fractured geometry was broken up.

When we want to change the degree of fragmentation of an object, we need to adjust the [Uniform Scale] in the [Explodedview] node.

Add the [attribnoise] node and adjust the impact values for [attribnoise] and [grid]. This will add more detail to the brokenness of the model.

Add [divide] node.

Final node diagram for the second crushing method:

Below we are going to create models that have the texture of broken wood.

The initial node is the same as before. At this point, we can see that the model is broken and looks like stone.

Create the [transform] node, then right mouse click on [Actions] in [transform], then select [Create Reference Copy].

Right mouse button to cancel [Invert Transformation channel] in [Transform Reference Copy]. Then select [Invert Transformation] again.

When we modify the scale of [transform] and uniform scale of [explodedview], we can change the degree to which the wood breaks.

The third type of fracture:

Create [rbdmaterialfracture].

[rbdmaterialfracture]:

Adjusting the value of [Scatter Points] in [rbdmaterialfracture] increases the number of fragments. And we can see that the third form of fragmentation is more natural.

You can adjust [Detail] in [rbdmaterialfracture] to add fracture detail to the model. I have adjusted [Edge Detail] and [Interior Detail].

Okay, let’s get started with some simulations.

First create the [sphere] ([Polygon] mode), [null] and [dopnet]. Increase the y-axis value of [sphere] so that [sphere’] is off the ‘ground’.

[dopnet]:

The DOP Network Object contains a DOP simulation. Simulations can consist of any number of simulation objects (which do not correspond to Objects that appear in /obj). These simulation objects are built and controlled by the DOP nodes contained in this node. Simulation-wide controls are provided on this node, such as caching options and time step controls. The entire simulation can also be transformed using the Transform parameters of this node. Transforming a simulation at this level does not affect the simulation at all. The Transform is applied after the simulation occurs.

Double click on the left mouse button to enter the [dopnet] node.

[rigidbodysolver]:

The RBD Solver DOP sets objects to use the Rigid Body Dynamics solver. If an object has this DOP as its Solver subdata, it will evolve itself as an RBD Object. This solver is a union of two different rigid body engines, the RBD engine and the Bullet engine. The RBD engine uses volumes and is useful for complicated, deforming, stacked, geometry. The Bullet engine offers simpler collision shapes and is suitable for fast, large-scale simulations.

[rbdsolver]:

[bulletrbdsolver]:

The Bullet Solver DOP sets objects to use the Bullet Dynamics solver. This solver can use simplified representation of the objects, such as boxes or spheres, or a composite of these simple shapes to make-up a more complex shape. This solver can use arbitrary convex shapes based on the geometry points of the object, and can also collide objects against affectors that are cloth, solid, or wire objects.

We just need to use [bulletrbdsolver].

Create [rbdobject] and change the object of [SOP Path].

Create [gravity] and [groundplane]. This is equivalent to giving the model gravity and a platform (the ground).

Adjusting [physical] in [rbdobject] and [groundplane] can change the state of the ball when it hits the ground (bounce on fall). [Initial State] in [rbdobject] changes the distance and state of the tumble after landing.

Now start creating the effect of dropping the broken cubes to the ground. Start by connecting the nodes of the previously broken cubes.

Add [assemble] node.

Final:

The [dopimport] and [transformpieces] can help make the model crushing process faster.

Next, we need to use Constraints.

Making models that only break when they fall and touch the ground.

The process of making a house fracture begins below.

Create [rbdmaterialfracture] under the house node of the simple cabin.

Then create [rbdbulletsolver].

Create [sphere] and use [Alt + Left Mouse Button] to create a keyframe animation. (Ball hits cabin)

Link the ball animation to [rbdbulletsolver].

Change the properties of [rbdbulletsolver].

The effect of the ball hitting the house at this point is not good. The house has been hit by the ball away from the initial spot, which looks very unnatural.

Let’s add some nodes.

This entry was posted in Houdini. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *