Skip to content

Commit

Permalink
Fix do not draw mesh normals for non-triangular meshes (#792)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamkewley committed Oct 6, 2023
1 parent b8b5afb commit b5dcc90
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/oscar/Scene/SceneRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,10 @@ class osc::SceneRenderer::Impl final {
}

// if normals are requested, render the scene element via a normals geometry shader
if (params.drawMeshNormals)
//
// care: this only works for triangles, because normals-drawing material uses a geometry
// shader that assumes triangular input (#792)
if (params.drawMeshNormals && dec.mesh.getTopology() == MeshTopology::Triangles)
{
Graphics::DrawMesh(dec.mesh, dec.transform, m_NormalsMaterial, m_Camera);
}
Expand Down

0 comments on commit b5dcc90

Please sign in to comment.