Skip to content

Commit

Permalink
Fix frustum culling on generated sub meshes
Browse files Browse the repository at this point in the history
  • Loading branch information
KillzXGaming committed Sep 8, 2024
1 parent 9f588fa commit c99d616
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,9 @@ static void CalculateMeshDivision(List<IOVertex> vertices, Shape fshp, Mesh mesh
indexList.Clear();
var divided = PolygonDivision.Divide(vertices, indices);

//keep first bounding as it determines camera frustum
var boundingFull = fshp.SubMeshBoundings.FirstOrDefault();

fshp.SubMeshBoundingNodes.Clear();
fshp.SubMeshBoundings.Clear();

Expand All @@ -542,6 +545,8 @@ static void CalculateMeshDivision(List<IOVertex> vertices, Shape fshp, Mesh mesh
SubMeshCount = 1,
});
}
//Full bounding at the end
fshp.SubMeshBoundings.Add(boundingFull);
}
else
{
Expand Down

0 comments on commit c99d616

Please sign in to comment.