From 4d54444fa16ef44e8bc071b7d006f601176f95a6 Mon Sep 17 00:00:00 2001 From: Matthew Date: Sat, 22 Nov 2025 15:25:40 +1100 Subject: [PATCH] add start and length to mesh parts --- assets.d | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/assets.d b/assets.d index 921ed79..aa8c3af 100644 --- a/assets.d +++ b/assets.d @@ -82,7 +82,6 @@ struct Material { u32 pipeline_id; MaterialMap[MMI.max] maps; - Vec4 params; } struct Vertex @@ -98,6 +97,8 @@ struct Mesh { Vertex[] vtx; u32[] idx; + u64 start; + u64 length; u32 mat_id; } @@ -723,7 +724,9 @@ AddMeshVertices(cgltf_accessor* accessor, Model* model, u64 mesh_index, u64* vtx { if(model.meshes[mesh_index].vtx == null) { - model.meshes[mesh_index].vtx = model.vtx_buf[*vtx_count .. *vtx_count+accessor.count]; + model.meshes[mesh_index].vtx = model.vtx_buf[*vtx_count .. *vtx_count+accessor.count]; + model.meshes[mesh_index].start = *vtx_count; + model.meshes[mesh_index].length = accessor.count; *vtx_count += accessor.count; } }