All algorithms presented so far don't affect visual appearance at all, with the exception of quantization that has minimal controlled impact. However, fundamentally the most effective way at reducing the rendering or transmission cost of a mesh is to make the mesh simpler.

到目前为止提出的所有算法都不会影响视觉外观,除了量化算法的影响最小。然而,从根本上说,降低网格渲染或传输成本的最有效方法是使网格更简单。

This library provides two simplification algorithms that reduce the number of triangles in the mesh. Given a vertex and an index buffer, they generate a second index buffer that uses existing vertices in the vertex buffer. This index buffer can be used directly for rendering with the original vertex buffer (preferably after vertex cache optimization), or a new compact vertex/index buffer can be generated using meshopt_optimizeVertexFetch that uses the optimal number and order of vertices.

这个库提供了两个简化算法来减少网格中的三角形数量

  1. meshopt_simplify
  2. meshopt_simplifySloppy

两种方法都是,给定一个顶点缓冲区和一个索引缓冲区,它们生成第二个索引缓冲区,该索引缓冲区使用顶点缓冲区中的现有顶点。

  • 这个索引缓冲区可以直接用于渲染原始的顶点缓冲区(最好是在顶点缓存优化之后)
  • 或者可以使用meshopt_optimizeVertexFetch生成一个新的紧凑的顶点/索引缓冲区,该缓冲区使用顶点的最佳数量和顺序