Skip to content

Commit

Permalink
GLTF PBR Renderer: skip empty primitives
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMostDiligent committed Oct 4, 2023
1 parent 97c24ea commit 40fdf1b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions PBR/src/GLTF_PBR_Renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,9 @@ void GLTF_PBR_Renderer::Render(IDeviceContext* pCtx,
// Render mesh primitives
for (const auto& primitive : Mesh.Primitives)
{
if (primitive.VertexCount == 0 && primitive.IndexCount == 0)
continue;

const auto& material = GLTFModel.Materials[primitive.MaterialId];
if (material.Attribs.AlphaMode != AlphaMode)
continue;
Expand Down

0 comments on commit 40fdf1b

Please sign in to comment.