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

◆ for_meshes()

static VertexLayout MayaFlux::Kakshya::VertexLayout::for_meshes ( uint32_t  stride = 60)
inlinestatic

Factory: layout for MeshVertex (position, color, weight, uv, normal, tangent)

Matches MeshVertex field order exactly (60 bytes): loc 0 offset 0 VERTEX_POSITIONS_3D position loc 1 offset 12 VERTEX_COLORS_RGB color loc 2 offset 24 SCALAR_F32 weight loc 3 offset 28 TEXTURE_COORDS_2D uv loc 4 offset 36 VERTEX_NORMALS_3D normal loc 5 offset 48 VERTEX_TANGENTS_3D tangent

Identical offset table to for_points() and for_lines(). FieldOperator processes all three types with the same constants.

Parameters
strideOverride stride (default: sizeof(MeshVertex) == 60)

Definition at line 185 of file VertexLayout.hpp.

186 {
187 VertexLayout layout;
188 layout.stride_bytes = stride;
189
190 layout.attributes.push_back({ .component_modality = DataModality::VERTEX_POSITIONS_3D,
191 .offset_in_vertex = 0,
192 .name = "position" });
193
194 layout.attributes.push_back({ .component_modality = DataModality::VERTEX_COLORS_RGB,
195 .offset_in_vertex = 12,
196 .name = "color" });
197
198 layout.attributes.push_back({ .component_modality = DataModality::SCALAR_F32,
199 .offset_in_vertex = 24,
200 .name = "weight" });
201
202 layout.attributes.push_back({ .component_modality = DataModality::TEXTURE_COORDS_2D,
203 .offset_in_vertex = 28,
204 .name = "uv" });
205
206 layout.attributes.push_back({ .component_modality = DataModality::VERTEX_NORMALS_3D,
207 .offset_in_vertex = 36,
208 .name = "normal" });
209
210 layout.attributes.push_back({ .component_modality = DataModality::VERTEX_TANGENTS_3D,
211 .offset_in_vertex = 48,
212 .name = "tangent" });
213
214 return layout;
215 }
@ SCALAR_F32
Single-channel float data.

References attributes, MayaFlux::Kakshya::SCALAR_F32, stride_bytes, MayaFlux::Kakshya::TEXTURE_COORDS_2D, MayaFlux::Kakshya::VERTEX_COLORS_RGB, MayaFlux::Kakshya::VERTEX_NORMALS_3D, MayaFlux::Kakshya::VERTEX_POSITIONS_3D, and MayaFlux::Kakshya::VERTEX_TANGENTS_3D.

Referenced by MayaFlux::Kakshya::as_mesh_vertex_access(), MayaFlux::Nodes::GpuSync::MeshWriterNode::compute_frame(), MayaFlux::IO::ModelReader::extract_single_mesh(), MayaFlux::Nodes::Network::FieldOperator::get_vertex_layout(), MayaFlux::Nodes::GpuSync::MeshWriterNode::MeshWriterNode(), and MayaFlux::Nodes::vertex_layout_for().

+ Here is the caller graph for this function: