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

◆ ComputeMeshBuffer() [2/2]

MayaFlux::Buffers::ComputeMeshBuffer::ComputeMeshBuffer ( const glm::vec3 &  bounds_min,
const glm::vec3 &  bounds_max,
uint32_t  res_x,
uint32_t  res_y,
uint32_t  res_z,
float  iso_level = 0.0F,
std::string  field_shader = "sdf_field_gyroid.comp" 
)

Construct in GPU-field mode.

No SpatialField is evaluated on CPU. sdf_field.comp evaluates the field entirely on the GPU each dirty frame. Animate by calling get_field_processor()->set_time(t) from a metro callback.

Chain order: default — SdfPrepProcessor (allocates + zeroes grid/counter) pre — SdfFieldProcessor (dispatches sdf_field.comp → grid) flat[0] — SDFMeshProcessor (mc_emit → vertices) final — RenderProcessor

Parameters
bounds_minWorld-space minimum corner.
bounds_maxWorld-space maximum corner.
res_xCell count along X (minimum 1).
res_yCell count along Y (minimum 1).
res_zCell count along Z (minimum 1).
iso_levelIsosurface threshold (default 0.0).
field_shaderOptional compute shader for field evaluation (default "sdf_field.comp").

Definition at line 43 of file ComputeMeshBuffer.cpp.

51 : VKBuffer(
52 worst_case_bytes(res_x, res_y, res_z),
55 , m_res_x(std::max(res_x, 1U))
56 , m_res_y(std::max(res_y, 1U))
57 , m_res_z(std::max(res_z, 1U))
58 , m_bounds_min(bounds_min)
59 , m_bounds_max(bounds_max)
60 , m_iso_level(iso_level)
61 , m_gpu_field(true)
62 , m_field_shader(std::move(field_shader))
63{
65 "ComputeMeshBuffer (GPU field): {}x{}x{} grid, {:.1f} MB worst-case",
67 static_cast<float>(get_size_bytes()) / (1024.F * 1024.F));
68}
#define MF_INFO(comp, ctx,...)
static size_t worst_case_bytes(uint32_t res_x, uint32_t res_y, uint32_t res_z) noexcept
vk::DeviceSize get_size_bytes() const
Definition VKBuffer.hpp:279
@ Init
Engine/subsystem initialization.
@ Buffers
Buffers, Managers, processors and processing chains.

References MayaFlux::Journal::Buffers, MayaFlux::Buffers::VKBuffer::get_size_bytes(), MayaFlux::Journal::Init, m_res_x, m_res_y, m_res_z, and MF_INFO.

+ Here is the call graph for this function: