14 layout.vertex_count = 0;
18 "Created MeshWriterNode with capacity for {} vertices", initial_vertex_capacity);
22 std::span<const MeshVertex> vertices,
23 std::span<const uint32_t> indices)
25 m_vertices.assign(vertices.begin(), vertices.end());
26 m_indices.assign(indices.begin(), indices.end());
33 m_vertices.assign(vertices.begin(), vertices.end());
40 m_indices.assign(indices.begin(), indices.end());
68 layout.vertex_count =
static_cast<uint32_t
>(
m_vertices.size());
72 "MeshWriterNode: uploaded {} vertices, {} indices ({} faces)",
#define MF_TRACE(comp, ctx,...)
#define MF_DEBUG(comp, ctx,...)
bool m_vertex_data_dirty
Flag: vertex data or layout changed since last GPU upload.
void set_vertex_layout(const Kakshya::VertexLayout &layout)
Set cached vertex layout.
void set_indices(std::span< const uint32_t > indices)
Set index buffer for indexed drawing.
void resize_vertex_buffer(uint32_t vertex_count, bool preserve_data=false)
Resize vertex buffer to hold specified number of vertices.
void set_vertex_stride(size_t stride)
Set vertex stride (bytes per vertex)
bool m_needs_layout_update
Flag indicating if layout needs update.
Base class for nodes that generate 3D geometry data.
MeshWriterNode(size_t initial_vertex_capacity=1024)
std::vector< MeshVertex > m_vertices
void set_mesh(std::span< const MeshVertex > vertices, std::span< const uint32_t > indices)
Replace all vertex and index data atomically.
void set_mesh_vertices(std::span< const MeshVertex > vertices)
Replace vertex array only; index array is unchanged.
Portal::Graphics::PrimitiveTopology get_primitive_topology() const override
Get primitive topology for rendering.
void set_mesh_indices(std::span< const uint32_t > indices)
Replace index array only; vertex array is unchanged.
std::vector< uint32_t > m_indices
void compute_frame() override
Compute GPU data for this frame.
@ NodeProcessing
Node graph processing (Nodes::NodeGraphManager)
@ Nodes
DSP Generator and Filter Nodes, graph pipeline, node management.
PrimitiveTopology
Vertex assembly primitive topology.
static VertexLayout for_meshes(uint32_t stride=60)
Factory: layout for MeshVertex (position, color, weight, uv, normal, tangent)
Vertex type for indexed triangle mesh primitives (TRIANGLE_LIST topology)