On this page |
Overview
Volumes allow you to store values for "voxels" (three dimensional pixels) in a space. This allows you to represent phenomena such as clouds, smoke, fire, as well as store simulation metadata such as velocity fields (store a velocity at each voxel, and use the velocity values to move (advect) other geometry), collision fields (store the 3D "hittable area" of an object as a sign distance field), and others.
Houdini supports two types of volume primitive at the geometry level, alongside other primitives such as polygons and NURBS surfaces. The two volume types are adapted for different uses, but Houdini’s tools attempt to work on them both generically where possible.
Tip
To surface nodes that operate on points (for example, the VOP SOP, volumes appear to be a single point at the center of the volume. You may need to use a volume-specific node to operate on the actual volume (for example, the Volume VOP SOP).
See also rendering volumes
Standard Houdini volumes
A standard Houdini volume is a box with a position, size, and orientation, subdivided into a 3D grid of voxels, with a value stored in each voxel. This type is used in modeling (SOPs) and simulation (DOPs).
Different types of volumes store different types of information in the voxels:
Scalar field (density)
Stores a single numeric value at each point. This is useful to represent smoke, where the value at each point represents the density of the smoke at that location.
Sign distance field (SDF)
Used to represent fluids. Stores a number at each point representing the distance to the fluid’s surface, with the sign of the number (positive or negative) indicating whether the point is inside or outside the fluid.
Vector field
Stores a vector at each point. This is actually represented using three scalar fields (for example Cd.r
, Cd.g
, Cd.b
) but Houdini knows to treat them as a single volume.
A common use for this type of a field is a velocity field for a gas simulation, which each point’s vector value represents the direction/velocity of the gas at that position.
(You can use the VDB Vector Merge node to combine three scalar VDB fields into a single vector VDB.)
OpenVDB volumes
An OpenVDB volume uses the OpenVDB library to represent a sparse volume very efficiently. A VDB volume uses essentially no memory for "empty" voxels (technically, voxels equal to the "background value"). This volume type is useful for modeling sparse volumes such as clouds and wispy smoke.
Because of the way this volume type is represented in memory, it does not require that you specify a box containing the volume; it can extend infinitely. Despite this, a VDB does define a 3D grid of voxels over the whole space.
OpenVDB volumes were added to Houdini in version 12.5.
You can write OpenVDB volumes to bgeo
files and load them at render time using the Mantra delayed load procedural, just as with standard Houdini volumes/geometry. You can render standard Houdini volumes and OpenVDB volumes together and they will mix properly.
Surface nodes with "VDB" in their title operate on VDB volumes. You can convert geometry to VDB volumes using the VDB from polygons and VDB from particles nodes. You can create an empty VDB volume using the VDB node. Other "VDB" nodes let you edit VDB volumes.
Many SOPs that operate on standard Houdini volumes also work with VDB volumes. The node help will indicate if a volume node doesn’t work with VDB volumes.
VEX functions, HOM functions, and Hscript commands that operate on standard Houdini volumes should work with VDB volumes as well.
Note
You cannot currently use VDB primitives in simulations.
Specifying volumes in group fields
In a node that operates on a volume, you may have multiple volumes in the input geometry and want to select which volume a node will affect, using the node’s Group parameter.
If you have a volume primitive named density
in the geometry, that is not a group. It’s just a primitive that has a name
attribute set to density
. You can’t type density
in a group field to select it.
Instead, to select a single volume by name in the Group parameter, use the attribute matching syntax @name=name
(for example, @name=density
).
Working with volumes in geometry networks
Tip
When you create volumes in SOPs, remember to fill in the Name parameter with a name describing the purpose of the volume (e.g. density
for smoke density). This will make it easier to work with volumes in SOPs and DOPs.
To... | Do this |
---|---|
See the outlines of standard volume containers in the view |
Turn on display of hulls (click the Display Hulls icon in the display toolbar on the right side of the viewer pane). You can also view the outline of volumes in wireframe mode. See how to change the view for more information. |
Create a standard volume from existing geometry |
|
Create a VDB volume from existing geometry |
Use the VDB from polygons or VDB from particles node. |
Create an empty or uniform volume primitive |
Tip The Volume SOP and VDB SOP can create a volume based on the position and field of view of a camera. This lets you limit the volume to the visible area of the scene for efficiency. |
Create a volume from an implicit function |
Use the Iso Surface SOP and turn on Build Volume. You can enter an expression in the Implicit function field to define the value of the volume at each voxel. For example, to create a uniform volume, enter |
Edit the values in a volume |
|
Convert between standard volumes and VDB volumes |
Use the Convert VDB SOP. |
Create geometry from a standard volume |
|
Create geometry from a VDB volume |
Use the Convert VDB SOP. |
Get the bounding box of the actual volume inside a container |
Use the Scatter SOP to scatter points inside the volume, then wire the points to a Bound SOP. |
Use volumes to edit other geometry |
The Volume analysis, Volume Bound, and Volume Break SOPs let you create other geometry from volumes in various ways. |
Use a volume primitive in nodes that take a volume file |
Some nodes, such as the Volume Sample from File VOP, use volume files. You can grab "live" data from a SOP instead of from a file using the |
Import data from a fluid or gas simulation as a volume primitive |
|
Shade and render volumes |
See volumetric rendering. |
Merging volumes
-
If you merge two volume primitives with the regular Merge SOP, the output contains multiple separate volume primitives (see how to refer to individual volume primitives below).
-
If you use the Volume Merge SOP or Volume Mix SOP, all volumes in the second input are merged into the volume in the first input.
When using Volume Merge/Volume Mix, it’s a good idea to connect an empty volume (created using the Volume SOP) (of the size and resolution you want) to the first input, and then connect all the volumes you want to merge together into the second input (using a Merge SOP).
To set the size of the empty volume you are merging into to the combined size of the volume you're merging, wire the Merge node (with the volumes to merge) into the Volume SOP’s input (which sets the empty volume’s size using the bounding box of the input geometry) as well as the second input of the Volume Merge/Mix node:
Tip
You can change the resolution of a volume by merging it into an empty volume created at the new resolution.
The Merge/Mix Method parameter on the Volume Merge/Volume Mix nodes controls how the values in the two volumes are combined.
-
To simply overlay two volumes, you will usually want to use "Maximum". Using "Add" with normalized (0-1) volumes will give you values greater than 1.
-
You can set the Volume Mix node’s Mix Method to "Difference" to carve the shape of one volume out of another.
Special effects
-
You can use volume nodes to edit surface geometry by converting the geometry to a volume, editing it, and converting back to a surface. This is an excellent technique for smoothly merging solid models. It also lets you use powerful tools such as the Volume VOP and Volume Wrangle surface nodes to edit solid geometry with total programmatic control.
-
Convert the geometry to a volume using the IsoOffset node.
-
Use the volume editing nodes to edit the volume.
-
Convert the volume back to a surface using the Convert Volume node.
-
-
The Attribute From Volume surface node lets you copy values from a volume onto nearby geometry. This is useful for special effects such as coloring objects as they move through a cloud.
See also |