Skip to content

Commit

Permalink
#5893: Don't attach empty model surfaces, the GeometryRenderer doesn'…
Browse files Browse the repository at this point in the history
…t support this
  • Loading branch information
codereader committed Feb 4, 2022
1 parent eacb2ea commit c028385
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions radiantcore/model/StaticModelNode.cpp
Expand Up @@ -30,6 +30,11 @@ void StaticModelNode::onInsertIntoScene(scene::IMapRootNode& root)
// Renderables will acquire their shaders in onPreRender
_model->foreachSurface([&](const StaticModelSurface& surface)
{
if (surface.getVertexArray().empty() || surface.getIndexArray().empty())
{
return; // don't handle empty surfaces
}

_renderableSurfaces.emplace_back(std::make_shared<RenderableModelSurface>(surface, localToWorld()));
});

Expand Down
5 changes: 5 additions & 0 deletions radiantcore/model/md5/MD5ModelNode.cpp
Expand Up @@ -76,6 +76,11 @@ void MD5ModelNode::onInsertIntoScene(scene::IMapRootNode& root)
// Renderables will acquire their shaders in onPreRender
_model->foreachSurface([&](const MD5Surface& surface)
{
if (surface.getVertexArray().empty() || surface.getIndexArray().empty())
{
return; // don't handle empty surfaces
}

_renderableSurfaces.emplace_back(
std::make_shared<model::RenderableModelSurface>(surface, localToWorld())
);
Expand Down

0 comments on commit c028385

Please sign in to comment.