Skip to content

Commit 2a156a1

Browse files
committed
pr updates
1 parent f1ad9a7 commit 2a156a1

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

AssetLoader/interface/GLTFBuilder.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,8 @@ Mesh* ModelBuilder::LoadMesh(const GltfModelType& GltfModel,
444444
if (GltfPrimitive.GetIndicesId() >= 0)
445445
{
446446
IndexCount = ConvertIndexData(GltfModel, GltfPrimitive.GetIndicesId(), VertexStart);
447+
// For indexed primitives, the vertex offset is baked into the indices,
448+
VertexStart = 0;
447449
}
448450

449451
int MaterialId = GltfPrimitive.GetMaterialId();

AssetLoader/interface/GLTFLoader.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -410,22 +410,22 @@ struct Primitive
410410
const Uint32 FirstIndex;
411411
const Uint32 IndexCount;
412412
const Uint32 VertexCount;
413-
const Uint32 VertexStart;
413+
const Uint32 FirstVertex;
414414
const Uint32 MaterialId;
415415

416416
const BoundBox BB;
417417

418418
Primitive(Uint32 _FirstIndex,
419419
Uint32 _IndexCount,
420420
Uint32 _VertexCount,
421-
Uint32 _VertexStart,
421+
Uint32 _FirstVertex,
422422
Uint32 _MaterialId,
423423
const float3& _BBMin,
424424
const float3& _BBMax) :
425425
FirstIndex{_FirstIndex},
426426
IndexCount{_IndexCount},
427427
VertexCount{_VertexCount},
428-
VertexStart{_VertexStart},
428+
FirstVertex{_FirstVertex},
429429
MaterialId{_MaterialId},
430430
BB{_BBMin, _BBMax}
431431
{

0 commit comments

Comments
 (0)