I'm working with the MeshLodGenerator. It's awesome but I have a couple minor issues.
Lines: It is not compatible with lines. Unbuffered input ignores lines and buffered input crashes on lines. It does not output lines.
This branch does some refactoring and addresses issue 1 by supporting input and output of lines. It does not yet collapse the lines at reduced lods because that may depend on how issue 2 is resolved.Hole punching: When a vertex at the seam between two submeshes is collapsed, if the source vertex did not already have an edge connecting to the destination vertex in that submesh then the triangle will be discarded:
https://github.com/OGRECave/ogre/blob/5 ... #L233-L241Code: Select all
size_t id = findDstID(srcID, triangle->submeshID); if (id == std::numeric_limits<size_t>::max()) { // Not found any edge to move along. // Destroy the triangle. data->mIndexBufferInfoList[triangle->submeshID].indexCount -= 3; output->triangleRemoved(data, triangle); removeTriangleFromEdges(triangle, src); continue; }
This leaves holes in the mesh's surface. This could be prevented by using a different cost calculator but it seems like you should not get holes no matter which cost you use. Maybe before we run the cost calculator we can mark edges as not collapsible if they connect vertices that do not exist in all the same submeshes.
Open to feedback on issue 1 and looking for ideas for issue 2.