Mesh.Optimize

Mesh.Optimize method

Optimize the mesh’s memory usage by eliminating duplicated control points

public Mesh Optimize(bool vertexElements)
ParameterTypeDescription
vertexElementsBooleanOptimize duplicated vertex element data

Return Value

New mesh instance with compact memory usage

Examples

The following code shows how to eliminate duplicated control points from an unoptimized mesh:

//Sphere.ToMesh generates 117 control points
var mesh = (new Sphere()).ToMesh();
//After optimized, there're only 86 control points, polygon indices are also remapped.
var optimized = mesh.Optimize(true);

See Also