Add mesh index buffer optimization based on meshoptimizer library

Work similar to existing impl but yields better results with even less overdraw.
This commit is contained in:
2026-06-01 18:41:45 +02:00
parent 45f7c1f0a0
commit a544cbcfde
5 changed files with 57 additions and 15 deletions
@@ -228,9 +228,16 @@ public:
/// <summary>
/// Reorders all triangles for improved vertex cache locality. It tries to arrange all triangles to fans and to render triangles which share vertices directly one after the other.
/// [Deprecated in v1.13]
/// </summary>
DEPRECATED("Use Optimize instead as it does more advanced optimizations on index buffer.")
void ImproveCacheLocality();
/// <summary>
/// Optimizes mesh vertex and index buffers for runtime rendering. Uses 'meshoptimizer' library.
/// </summary>
void Optimize();
/// <summary>
/// Sums the area of all triangles in the mesh.
/// </summary>