Volume, Core Concepts in Houdini
Download Houdini Project File: what is a volume.hiplc
Distance VDB vs Fog VDB
Brief explanation of “Distance VDB vs Fog VDB” from the VDB from Polygon node is below, please scroll down if you only want to read about that.
Volumes are made up of voxels and behave much differently when compared to polygon geometry in the CGI world. Voxels store values which is used to render, display, and visualize the volume in the 3D software like Houdini. When we have density values for our volume, we can definitely start rendering it out in Houdini. It will automatically display on the 3D viewport when density values are present.
Your computer monitor resolution is determined by the number of pixels you have. It could have 1920x1080 pixels to be true HD. Imagine you have several monitors stacked on top of each other, lets say 5 monitors stack on top of each other. Now you have a bunch of monitors forming a cube shape. 1920x1080x5. You can picture each pixel as a even smaller cube within this stack of monitors.
1920 x 1080 x 5 = 10,368,000
That’s a lot of pixels.
That’s a lot of cubes!
Voxels are organized in a similar fashion in volumes. Each voxel storing its own density value or other attribute value.
Have you ever played Minecraft? Sometimes voxels remind me a lot of Minecraft. Every cube pixel represents a voxel and stores it own data types.
Volumes are Fast!
Due to the nature of how voxels behave, there is always a fixed number of voxels in every volume. It doesn’t matter how big or small the volume size is, the number of voxels are finite. This makes calculations predictable and fast.
In polygons, the number of points depends on the geometry. For example, 3D models of characters with detailed facial expressions will probably contain more points due to the fact that the facial features need more resolution and geometry to display properly on the screen. However if you have a fixed number of voxels in every volume, it makes the math a lot easier and algorithms become more predictable. You can use the same matrix operations to manipulate the volumes.
I did say that volumes have a fixed number of voxels, however VDB is a new type of volumes. VDB is runs more efficiently and occupies less memory. The way VDB saves on memory is by excluding the empty voxels from the volume. If it’s empty, no need in storing data with null value.
As of Houdini 16 and later, I believe all the volumes in Houdini are using VDB replacing the old Houdini Volumes. I could be wrong about the Houdini version, but definitely SideFX made an update a few years back and now all or most of the operations deal with VDB’s.
In polygons, Houdini stores data in attributes. For volumes, there is primitives. Since each volume can only store one scalar value, there is only one type of data for each primitive volume.
Operations can then be done on the data stored in the volume primitives. That brings us to VolumeVOPs. All operations that happens inside the VolumeVOP node are computed in parallel. It uses the multi-cores in your computer to do all the multi-threading, therefore all calculations done inside the VolumeVOP are very fast.
Distance VDB vs Fog VDB
In the VDB From Polygon node there are two options, “Distance VDB” and “Fog VDB”. The Distance VDB creates an SDF (signed distance field) volume.
It will use the voxel positions compared to the surface of the polygon and calculate the distance between the two as a SDF value and store it in the density volume primitive. If the voxels are inside the polygon, all values are negative.
SDF = absolute(Voxel position - surface position of polygon)
if voxel inside polygon: -SDF
if voxel outside polygon: +SDF
This means, the surface position is subtracted from each voxel position. Then the absolute value is taken from that result. And then if the voxel is located inside the polygon, it will be made negative and if the voxel is located outside the polygon, it will be made positive.
The Fog VDB option simply creates a density values of 0’s and 1’s. If the voxel is located on the surface of the polygon it will 1. And if the voxel is located anywhere else it will be 0. Since the polygon surface is rather thin and hard to get an exact match if the voxel is exactly located on the surface there are “Fill Bands” that can be used as options.
“Exterior Band Voxels” will provide an offset, an extra amount of distance from the surface of the polygon plus N number of voxels you specify as a range. If the voxel is within this range it will count as being on the surface and will be given a density value of 1.
“Interior Band Voxels” is very similar, except it is distance within the polygon (inside the polygon). You specify N number of voxels ranging from the surface of the polygon that goes toward the inside of the polygon. And if the voxel is within this inside range, it will be given a density value of 1.
The “Band Voxels” options can be used for both “Distance VDB” and “Fog VDB”, however I find it more useful for “Fog VDB”.