Make volumes in geometry nodes more useful and flexible.
Volumes have properties that make it a unique tool in the box:
In short: Volumes can do many things faster than other geometry, and some things that are (almost) impossible otherwise.
Some improvements to expect:
Construct mesh surface from a SDF volume
Remove density from a fog volume
Combining and rendering SDF operations
Make holes in cheese:
Links:
Basic FLIP fluids (with point cloud sampling)
Links:
Hair self-collision using volumes
Links:
Geometry Nodes currently has only very basic volume support for conversions to and from other geometry. With the experimental "New Volume Nodes" enabled there are a few more nodes for sampling and SDF manipulation.
Volumes are treated largely as "black boxes":
Volumes can already store multiple distinct grids, e.g. when loading from .vdb
files. These are not accessible individually, nodes have to use the "active" grid index and special names to find which grids to operate on.
Combining grids is not supported currently. This would be a frequent occurrence e.g. in SDF modeling. Without access to individual grids it's not obvious which grids should be combined.
Some interaction with grids is possible using sampling and conversion to other geometry, but it's not very efficient. Many useful features of grids can't be utilized this way, e.g. spatial lookups of neighboring points.
Volume geometry gets attribute support. Each attribute represents a named or anonymous grid in the volume.
The Voxel
domain represents grid cells, which are the main elements of grids.
Goal is to provide necessary features to unlock volume geometry access. Later tools and simulations can build on top of this initial stage.
Conversion from mesh and point geometry will output a density grid (fog volume) or distance grid (SDF volume) in addition to the Volume geometry. This is an anonymous attribute of the volume, rather than a named attribute as is currently the case.
A new Grid Info node provides additional information about a grid:
The Domain Size node in Voxel domain mode returns the number of active voxels of the grid.
The Transform node for grids simply changes the voxel scale and origin. The actual grid data is local to grid cells, there is no position attribute that needs to be calculated.
Change the voxel scale or origin and generate a new grid by interpolating the old grid values. This generally comes with a loss of precision and potential aliasing artifacts, same as when resampling images. Higher-order sampling methods can be used to reduce some of these artifacts.
Sample Volume already has a "Grid" input, but this is a hack: it expects an arbitrary named field and then uses the same name to find a volume grid internally. This will no longer be necessary, the input itself becomes a grid field that can be sampled directly.
This is a variation of the Sample Index node. The usual element index of points, faces, edges, etc. does not work well with grids, since voxel indices depend very much on grid topology. Instead a grid is typically indexed using coordinates (i,j,k)
. Unlike the Sample Volume node
The Sample Volume node is one way of reading grid data, but its position input includes the grid transform. A new "Evaluate at Coordinate" node provides direct access based on integer coordinates, ignoring the grid scale.
Field evaluation with grid inputs produces grid outputs, which can be stored or captured. Multifunctions, like math or color mixing, work on voxel values. Each output voxel value is computed by evaluating inputs at the voxel location.
Implementation Note: When input grids in a field graph have different transforms the evaluator needs to resample the grids, which causes artificial smoothing and reduces performance. Using the same grid transform is preferable because node graphs can be evaluated per leaf buffer as simple multifunctions.
Each volume grid has a transform which determines the size of voxels. For example a grid with a scale of 0.25 has a voxel size of 0.25 units. A volume component has a default transform, which is the transform of the active grid.
Nodes that construct a grid from a mesh, point cloud, cube or sphere all have one or both of the following options:
A Volume Info node will provide the transform of an existing volume so it can be copied by other nodes. Using consistent transforms between grids improves performance and avoid loss of precision due to interpolation. It should be the preferred option when creating new grids to reuse an existing transform.
For conventional fields in geometry nodes the size of buffers is directly defined by the domain, with the possible use of selection as a filter.
For grids the situation is more complicated: Each grid has, by design, its own extent and topology (which voxels are active). When combining multiple grids in a function, say an "Add" math node, the result will usually be a union of the active grid cells. The input grids have a background value that is used when a voxel is inactive.
Empty Input Case: Some field inputs are not grids themselves but abstract functions, like the "Voxel Center" input. These fields do not have a concrete set of voxels. When all input fields are abstract the resulting grid would be empty. A fallback for this case could be to use the "active grid" topology, or provide a user-defined default grid.
Not part of the MVP
The spreadsheet shows grid attributes for debugging purposes. Each colume contains values in a grid. Each row contains attributes for the same voxel, identified by its grid coordinates (i,j,k)
.
Unlike existing geometry components the Volume attributes are grids, which can have different topology and voxel count. A voxel may be active in some grids but not others, so a spreadsheet row can have gaps when the voxel it represents is not active in the column for a grid.
Implementation Note: The index of a voxel depends on the overall voxel count, it should not be stored or used for sampling.
Viewport display for volumes is not very useful for viewer nodes at this point. The viewport can only display float value grids as a density-style fog volume.
Viewport rendering of volume should take more grid types into account, as well as other settings such as the staggered grid class for vector grids.
Additional techniques for visualizing useful grid information:
OpenVDB has a specialized grid type for storing large point clouds efficiently and with better accuracy than the current Point Cloud geometry (OpenVDB overview). This PointDataGrid
forms the basis of fluid simulations.
PointDataGrid
.