MayaFlux 0.5.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ VolumeSurfaceProcessor()

MayaFlux::Buffers::VolumeSurfaceProcessor::VolumeSurfaceProcessor ( std::shared_ptr< VolumeGridBuffer volume,
std::string  field_name,
Kinesis::Lattice3D  lattice,
float  threshold,
const std::string &  shader_path = "volume_to_sdf_grid.comp.spv" 
)

Construct a surface extraction bridge.

Parameters
volumeVolume whose field is resampled.
field_nameName of the scalar field resampled. Must have stride sizeof(float).
latticeExtraction lattice, normally the volume's own lattice resampled to a different resolution over the same bounds.
thresholdField value the surface is placed at.
shader_pathPath to the compute shader.

Definition at line 13 of file VolumeSurfaceProcessor.cpp.

19 : ComputeProcessor(shader_path, k_workgroup_x)
20 , m_volume(std::move(volume))
21 , m_field_name(std::move(field_name))
22 , m_lattice(std::move(lattice))
24{
25 m_config.bindings["field_in"] = ShaderBinding(0, 0, vk::DescriptorType::eStorageBuffer);
26 m_config.bindings["grid_out"] = ShaderBinding(0, 1, vk::DescriptorType::eStorageBuffer);
27
28 m_config.push_constant_size = sizeof(SurfaceParams);
29
31 set_manual_dispatch((corner_count() + k_workgroup_x - 1) / k_workgroup_x, 1, 1);
32
34}
float threshold
ComputeProcessor(const std::string &shader_path, uint32_t workgroup_x=256)
Construct processor with shader path.
void set_dispatch_mode(ShaderDispatchConfig::DispatchMode mode)
Set dispatch mode.
void set_manual_dispatch(uint32_t x, uint32_t y=1, uint32_t z=1)
Set manual dispatch group counts.
void rebuild_grid_buffer()
Allocate the corner grid buffer for the current resolution.
std::shared_ptr< VolumeGridBuffer > m_volume
The attached volume, cached for the descriptor write.
uint32_t corner_count() const noexcept
Corner count of the grid, one greater per axis than the extraction resolution.
std::unordered_map< std::string, ShaderBinding > bindings

References MayaFlux::Buffers::ShaderConfig::bindings, corner_count(), MayaFlux::Buffers::ShaderProcessor::m_config, MayaFlux::Buffers::ShaderDispatchConfig::MANUAL, MayaFlux::Buffers::ShaderConfig::push_constant_size, rebuild_grid_buffer(), MayaFlux::Buffers::ComputeProcessor::set_dispatch_mode(), and MayaFlux::Buffers::ComputeProcessor::set_manual_dispatch().

+ Here is the call graph for this function: