From c457d7c7e3c231ef441e9b65a50f81e87dae590a Mon Sep 17 00:00:00 2001 From: Chris Adams Date: Tue, 4 Nov 2025 14:17:26 -0500 Subject: [PATCH 1/3] updated in vertex start position for GLTF files with mixes primitives (indices/no indices) --- PBR/src/GLTF_PBR_Renderer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PBR/src/GLTF_PBR_Renderer.cpp b/PBR/src/GLTF_PBR_Renderer.cpp index d0a29114..32e8db3d 100644 --- a/PBR/src/GLTF_PBR_Renderer.cpp +++ b/PBR/src/GLTF_PBR_Renderer.cpp @@ -774,7 +774,8 @@ void GLTF_PBR_Renderer::Render(IDeviceContext* pCtx, else { DrawAttribs drawAttrs{primitive.VertexCount, DRAW_FLAG_VERIFY_ALL}; - drawAttrs.StartVertexLocation = BaseVertex; + //drawAttrs.StartVertexLocation = BaseVertex; + drawAttrs.StartVertexLocation = BaseVertex + primitive.VertexStart; pCtx->Draw(drawAttrs); } } From e93dc8d7e119d9166b9fc65e10555b23fd3b9b48 Mon Sep 17 00:00:00 2001 From: Chris Adams Date: Tue, 4 Nov 2025 14:18:51 -0500 Subject: [PATCH 2/3] cleanup --- PBR/src/GLTF_PBR_Renderer.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/PBR/src/GLTF_PBR_Renderer.cpp b/PBR/src/GLTF_PBR_Renderer.cpp index 32e8db3d..6567cdd4 100644 --- a/PBR/src/GLTF_PBR_Renderer.cpp +++ b/PBR/src/GLTF_PBR_Renderer.cpp @@ -774,7 +774,6 @@ void GLTF_PBR_Renderer::Render(IDeviceContext* pCtx, else { DrawAttribs drawAttrs{primitive.VertexCount, DRAW_FLAG_VERIFY_ALL}; - //drawAttrs.StartVertexLocation = BaseVertex; drawAttrs.StartVertexLocation = BaseVertex + primitive.VertexStart; pCtx->Draw(drawAttrs); } From 08074071158b5352eb414afe8bfd9e3048f47ed3 Mon Sep 17 00:00:00 2001 From: Chris Adams Date: Thu, 6 Nov 2025 11:27:22 -0500 Subject: [PATCH 3/3] added clarity --- PBR/src/GLTF_PBR_Renderer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PBR/src/GLTF_PBR_Renderer.cpp b/PBR/src/GLTF_PBR_Renderer.cpp index 6567cdd4..eb9f81d1 100644 --- a/PBR/src/GLTF_PBR_Renderer.cpp +++ b/PBR/src/GLTF_PBR_Renderer.cpp @@ -774,7 +774,7 @@ void GLTF_PBR_Renderer::Render(IDeviceContext* pCtx, else { DrawAttribs drawAttrs{primitive.VertexCount, DRAW_FLAG_VERIFY_ALL}; - drawAttrs.StartVertexLocation = BaseVertex + primitive.VertexStart; + drawAttrs.StartVertexLocation = BaseVertex + primitive.FirstVertex; pCtx->Draw(drawAttrs); } }