11 const glm::vec3& bounds_min,
12 const glm::vec3& bounds_max,
18 , m_field(
std::move(field))
19 , m_bounds_min(bounds_min)
20 , m_bounds_max(bounds_max)
21 , m_res_x(
std::max(res_x, 1U))
22 , m_res_y(
std::max(res_y, 1U))
23 , m_res_z(
std::max(res_z, 1U))
24 , m_iso_level(iso_level)
69 if (!data.is_valid()) {
71 "SDFNode: no isosurface crossings at iso_level={}",
m_iso_level);
#define MF_WARN(comp, ctx,...)
void set_mesh(const Kakshya::MeshData &data)
Replace all vertex and index data from a MeshData owner.
void compute_frame() override
Compute GPU data for this frame.
Indexed triangle mesh for static or infrequently-updated geometry.
void set_field(Kinesis::SpatialField field)
Replace the scalar field and mark dirty.
void set_bounds(const glm::vec3 &bounds_min, const glm::vec3 &bounds_max)
Replace the evaluation volume and mark dirty.
SDFNode(Kinesis::SpatialField field, 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)
Construct and evaluate the initial isosurface.
void compute_frame() override
Re-extract the isosurface if dirty, then upload via parent.
void set_resolution(uint32_t res_x, uint32_t res_y, uint32_t res_z)
Replace the grid resolution and mark dirty.
Kinesis::SpatialField m_field
void set_iso_level(float iso_level)
Replace the iso_level threshold and mark dirty.
@ NodeProcessing
Node graph processing (Nodes::NodeGraphManager)
@ Nodes
DSP Generator and Filter Nodes, graph pipeline, node management.
MAYAFLUX_API Kakshya::MeshData generate_sdf_mesh(const Kinesis::SpatialField &field, 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)
Extract an isosurface from a scalar field using marching cubes.
Typed, composable, stateless callable from domain D to range R.