75 std::shared_ptr<VolumeGridBuffer> volume,
76 std::string field_name,
79 const std::string& shader_path =
"volume_to_sdf_grid.comp.spv");
89 [[nodiscard]] std::shared_ptr<VKBuffer>
grid_buf()
const {
return m_grid_buf; }
101 [[nodiscard]] uint32_t
get_res_x()
const {
return m_lattice.resolution.x; }
104 [[nodiscard]] uint32_t
get_res_y()
const {
return m_lattice.resolution.y; }
107 [[nodiscard]] uint32_t
get_res_z()
const {
return m_lattice.resolution.z; }
118 return static_cast<uint32_t
>(m_lattice.corner_count());
130 return static_cast<uint32_t
>(m_lattice.cell_count()) * 15U;
138 void on_attach(
const std::shared_ptr<Buffer>& buffer)
override;
143 void on_descriptors_created()
override;
160 void processing_function(
const std::shared_ptr<Buffer>& buffer)
override;
168 void write_field_descriptor();
180 void rebuild_grid_buffer();
Specialized ShaderProcessor for Compute Pipelines.
uint32_t get_res_z() const
Extraction cell count along Z.
Kinesis::Lattice3D m_lattice
uint32_t get_res_x() const
Extraction cell count along X.
~VolumeSurfaceProcessor() override=default
std::shared_ptr< VolumeGridBuffer > m_volume
The attached volume, cached for the descriptor write.
std::shared_ptr< VKBuffer > m_grid_buf
const Kinesis::Lattice3D & get_lattice() const
The extraction lattice.
uint32_t get_res_y() const
Extraction cell count along Y.
float get_threshold() const
Field value the surface is placed at.
std::shared_ptr< VKBuffer > grid_buf() const
The corner grid this stage writes.
uint32_t worst_case_vertices() const noexcept
Upper bound on vertices mc_emit can produce at this resolution.
uint32_t corner_count() const noexcept
Corner count of the grid, one greater per axis than the extraction resolution.
ComputeProcessor resampling one scalar field of a VolumeGridBuffer into the corner grid layout the ma...
Push constant block the resample shader receives.
A regular subdivision of an AABB3D into a cell count per axis.