Nodes: SDF Volume nodes milestone 1

Geometry Nodes: SDF Volume nodes milestone 1

Adds initial support for SDF volume creation and manipulation.
`SDF volume` is Blender's name of an OpenVDB grid of type Level Set.
See the discussion about naming in #91668.

The new nodes are:
- Mesh to SDF Volume: Converts a mesh to an SDF Volume
- Points to SDF Volume: Converts points to an SDF Volume
- Mean Filter SDF Volume: Applies a Mean Filter to an SDF
- Offset SDF Volume: Applies an offset to an SDF
- SDF Volume Sphere: Creates an SDF Volume in the shape of a sphere

For now an experimental option `New Volume Nodes` needs to be
enabled in Blender preferences for the nodes to be visible.

See the current work plan for Volume Nodes in #103248.

Pull Request: blender/blender#105090
This commit is contained in:
2023-03-19 11:21:08 +01:00
parent e13ae37e8b
commit 4b30b5c57f
23 changed files with 1101 additions and 224 deletions

View File

@@ -36,20 +36,25 @@ struct MeshToVolumeResolution {
*/
float volume_compute_voxel_size(const Depsgraph *depsgraph,
FunctionRef<void(float3 &r_min, float3 &r_max)> bounds_fn,
const MeshToVolumeResolution resolution,
MeshToVolumeResolution resolution,
float exterior_band_width,
const float4x4 &transform);
/**
* Add a new VolumeGrid to the Volume by converting the supplied mesh
* Add a new fog VolumeGrid to the Volume by converting the supplied mesh.
*/
VolumeGrid *volume_grid_add_from_mesh(Volume *volume,
const StringRefNull name,
const Mesh *mesh,
const float4x4 &mesh_to_volume_space_transform,
float voxel_size,
bool fill_volume,
float exterior_band_width,
float interior_band_width,
float density);
VolumeGrid *fog_volume_grid_add_from_mesh(Volume *volume,
StringRefNull name,
const Mesh *mesh,
const float4x4 &mesh_to_volume_space_transform,
float voxel_size,
bool fill_volume,
float exterior_band_width,
float interior_band_width,
float density);
/**
* Add a new SDF VolumeGrid to the Volume by converting the supplied mesh.
*/
VolumeGrid *sdf_volume_grid_add_from_mesh(
Volume *volume, StringRefNull name, const Mesh &mesh, float voxel_size, float half_band_width);
#endif
} // namespace blender::geometry