Skip to main content

Crate meshoptimizer_rs

Crate meshoptimizer_rs 

Source
Expand description

A Rust port of meshoptimizer 1.3.

Every ported function produces byte-identical output to meshoptimizer 1.3 (scalar build). Differential runs against the C++ library, seeded sweeps, fuzzing and a wasm32 identity check prove this on the recorded inputs.

The crate is safe Rust except for one module, codec::simd, which holds the SIMD kernels for vertex decoding, EXT filters, meshlet decoding and spatial meshlet box sweeps. Every unsafe block there has a written safety argument, and every SIMD path must produce the same bytes as the scalar safe-Rust path, which is the reference and the fallback. Build with default-features = false (adding std if needed) to compile no unsafe code; output is identical. Cargo feature unification applies: if any other crate in the dependency graph enables simd, the module is compiled for the whole graph. Simplification, optimization, index decoding and all encoders contain no unsafe in either configuration. See the safety audit.

The crate needs no C++ toolchain. It supports no_std with alloc. Invalid input returns a typed Error instead of undefined behaviour. A reusable Workspace holds scratch memory, makes every allocation fallible and enforces per-call memory and work Limits.

This is an independent project. It is not affiliated with meshoptimizer or its author. Coverage, measured performance and the parity records are in the README.

Coverage includes vertex processing, simplification, meshlets, codecs, analyzers, opacity maps, tangents, normals, remeshing, parallel batches and SIMD decoding. Cluster-LOD building requires clusterlod; DAG serialization is always available. Batches require parallel and std. Normal generation and remeshing require experimental.

§Index widths

Existing names keep their u32 signatures. Add _generic to index-processing function and width-aware method names to select the sealed Index trait (u16 or u32). For example, optimize_vertex_cache_generic accepts &[u16] and returns Vec<u16>. Output-only calls take a type argument, such as simplify_points_generic::<u16>. Narrowing returns Error::IndexOverflow instead of truncating. Width-aware structs use a Generic suffix, such as MeshletsGeneric. Original struct names remain concrete u32 forms. Existing byte-oriented codec layouts retain their upstream conversion rules; the typed index APIs check narrowing. See the 16-bit recipe.

§Recipes

§Simplify a mesh

use meshoptimizer_rs::{simplify, Positions, SimplifyOptions, SimplifySettings, Workspace};

let positions = [[0.0, 0.0, 0.0], [1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [1.0, 1.0, 0.0]];
let indices = [0, 1, 2, 2, 1, 3];
let mut workspace = Workspace::default();

let settings = SimplifySettings {
    target_index_count: 3,
    target_error: 0.01,
    options: SimplifyOptions::EMPTY,
};
let lod = simplify(&indices, Positions::from_packed(&positions), settings, &mut workspace)?;
println!("{} indices, relative error {}", lod.indices.len(), lod.error);

§Optimize for the vertex cache, then for overdraw

use meshoptimizer_rs::{optimize_overdraw, optimize_vertex_cache, Positions, Workspace};

let positions = [[0.0, 0.0, 0.0], [1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [1.0, 1.0, 0.0]];
let indices = [0, 1, 2, 2, 1, 3];
let mut workspace = Workspace::default();

let cached = optimize_vertex_cache(&indices, positions.len(), &mut workspace)?;
let ordered = optimize_overdraw(&cached, Positions::from_packed(&positions), 1.05, &mut workspace)?;
assert_eq!(ordered.len(), indices.len());

§Build meshlets

use meshoptimizer_rs::{build_meshlets, MeshletSettings, Positions, Workspace};

let positions = [[0.0, 0.0, 0.0], [1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [1.0, 1.0, 0.0]];
let indices = [0, 1, 2, 2, 1, 3];
let mut workspace = Workspace::default();

// 64 vertices and 124 triangles per meshlet; cone weight 0.25.
let built = build_meshlets(
    &indices,
    Positions::from_packed(&positions),
    MeshletSettings::default(),
    0.25,
    &mut workspace,
)?;
for meshlet in &built.meshlets {
    let start = meshlet.vertex_offset as usize;
    let vertices = &built.vertices[start..start + meshlet.vertex_count as usize];
    println!("{} triangles over vertices {:?}", meshlet.triangle_count, vertices);
}

§Compress vertex and index buffers

The codec module reads and writes the EXT_meshopt_compression formats. Buffers are little-endian bytes. The format version and level are set per call instead of through global setters.

use meshoptimizer_rs::codec::{
    decode_index_buffer, decode_vertex_buffer, encode_index_buffer, encode_vertex_buffer,
    IndexEncoding, VertexEncoding,
};
use meshoptimizer_rs::Workspace;

let positions: [[f32; 3]; 4] = [[0.0, 0.0, 0.0], [1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [1.0, 1.0, 0.0]];
let indices = [0, 1, 2, 2, 1, 3];
let mut workspace = Workspace::default();

let vertex_bytes: Vec<u8> = positions.iter().flatten().flat_map(|v| v.to_le_bytes()).collect();
let packed = encode_vertex_buffer(&vertex_bytes, 4, 12, VertexEncoding::DEFAULT, &mut workspace)?;
assert_eq!(decode_vertex_buffer(4, 12, &packed, &mut workspace)?, vertex_bytes);

let packed = encode_index_buffer(&indices, IndexEncoding::DEFAULT, &mut workspace)?;
let decoded = decode_index_buffer(indices.len(), 4, &packed, &mut workspace)?; // u32 bytes
assert_eq!(decoded.len(), indices.len() * 4);

§Features

  • std (default): implements std::error::Error for Error. Disable default features for no_std; an allocator is still required.
  • clusterlod: the cluster-LOD builder from upstream’s demo/clusterlod.h. DAG serialization and flat record types are always available. It reproduces the pinned demo exactly; it is not a stable upstream API.
  • experimental: upstream functions and options marked experimental.
  • parallel: ordered Rayon batch APIs for independent meshes and buffer views, plus parallel vertex encode/decode and spatial meshlet building for one large input; enables std. See the parallel module for limits and error semantics.

Modules§

clusterlod
Pure-Rust port of the pinned upstream demo/clusterlod.h (MIT, Arseny Kapoulkine).
codec
meshoptimizer 1.3 codecs, with explicit little-endian byte buffers.
guide
Task recipes with complete, checked examples.
parallel
Ordered batches of independent sequential operations, using Rayon.

Structs§

AlphaMask
Read-only 8-bit alpha plane for trim_alpha_cards. Not in C++ meshoptimizer.
AnalysisLists
Bounded defect lists from analyze_mesh. Not in C++ meshoptimizer.
AnalyzeOptions
Options for analyze_mesh. Not in C++ meshoptimizer.
Attributes
Checked borrowed attribute view with at most 32 components per vertex.
AttributesMut
Checked mutable attribute components for destructive update simplification.
BoundaryComponent
One connected set of boundary edges from analyze_mesh. Not in C++ meshoptimizer.
Bounds
Meaningful fields of meshopt_Bounds, without native padding.
BoundsPositions
A borrowed positions view whose bounds-validation scan is cached once.
CardTrimOptions
Settings for trim_alpha_cards. Not in C++ meshoptimizer.
CardTrimReport
Counts and texture-space areas. Not in C++ meshoptimizer.
CharacterInputs
Borrowed character data; not in C++ meshoptimizer.
CharacterLodChain
Character levels and sampled pose quality; not in C++ meshoptimizer.
CharacterLodSelection
Per-level sampled candidate scores; not in C++ meshoptimizer.
CharacterOptions
Metric weights; not in C++ meshoptimizer.
CharacterSkin
Up to eight linear blend skinning influences; not in C++ meshoptimizer.
CoverageStatistics
Result of meshopt_analyzeCoverage.
FetchIndices
The source-compatible u32 form of FetchIndicesGeneric. Borrowed fetch-remap input with its index-validation result cached once.
FetchIndicesGeneric
Borrowed fetch-remap input with its index-validation result cached once.
FetchedMesh
The source-compatible u32 form of FetchedMeshGeneric. Fetch-ordered initialized vertex bytes and rewritten indices.
FetchedMeshGeneric
Fetch-ordered initialized vertex bytes and rewritten indices.
FillHolesReport
Hole filling changes and refusals; not in C++ meshoptimizer.
FilledMesh
The source-compatible u32 form of FilledMeshGeneric. Original indices plus filled faces; not in C++ meshoptimizer.
FilledMeshGeneric
Original indices plus filled faces; not in C++ meshoptimizer.
HiddenOptions
Sampling controls. Not in C++ meshoptimizer. Always available, including no_std.
HiddenReport
Counts by disjoint removal reason. Not in C++ meshoptimizer.
HoleLoop
One boundary component decision; not in C++ meshoptimizer.
ImpostorAtlas
Baked atlas. Not in C++ meshoptimizer.
ImpostorBlend
Views and weights from ImpostorGrid::blend. Not in C++ meshoptimizer.
ImpostorBounds
Bounding sphere shared by every view. Not in C++ meshoptimizer.
ImpostorFrame
Orthographic capture frame of one view. Not in C++ meshoptimizer.
ImpostorGrid
The square grid of view directions. Not in C++ meshoptimizer.
ImpostorOptions
Settings for bake_impostor. Not in C++ meshoptimizer.
ImpostorReconstruct
Settings for ImpostorAtlas::reconstruct_texel and ImpostorAtlas::reconstruct_view. Not in C++ meshoptimizer.
ImpostorReport
Counts from bake_impostor. Not in C++ meshoptimizer.
ImpostorSwitch
Impostor switch distance and its error terms. Not in C++ meshoptimizer.
Limits
Per-call limits for crate-owned heap storage and counted work.
LocalMeshlet
The source-compatible u32 form of LocalMeshletGeneric. Meshlet-local topology with first-visit vertex references.
LocalMeshletGeneric
Meshlet-local topology with first-visit vertex references.
LodCamera
Pinhole camera used to turn world-space deviation into switch distance.
LodChain
The source-compatible u32 form of LodChainGeneric. The generated levels in target order.
LodChainAttributes
Attribute inputs passed unchanged to the simplifier.
LodChainError
A failed build_lod_chain call: the underlying Error and the level it occurred in.
LodChainGeneric
The generated levels in target order.
LodChainOptions
Parameters for the LOD chain builder. Build one with Self::new and the with_* setters; the struct is #[non_exhaustive] so options can be added.
LodDistance
Sampled distance statistics in world units.
LodLevel
The source-compatible u32 form of LodLevelGeneric. One simplification result. Errors describe this call, not cumulative chain error.
LodLevelGeneric
One simplification result. Errors describe this call, not cumulative chain error.
LodNormalDeviation
Shading-normal angular deviation in radians.
LodQuality
Quality of a level relative to the source; not in C++ meshoptimizer.
LodQualityLevel
One chain level’s quality and optional camera threshold.
LodQualityMesh
The source-compatible u32 form of LodQualityMeshGeneric. A borrowed triangle surface. Only referenced vertices are measured/validated.
LodQualityMeshGeneric
A borrowed triangle surface. Only referenced vertices are measured/validated.
LodQualityOptions
Deterministic sampling settings (not in C++ meshoptimizer).
MeshAnalysis
Topology report from analyze_mesh. Not in C++ meshoptimizer.
Meshlet
Current 1.3 descriptor: triangle offsets are consecutive byte offsets, without padding.
MeshletSettings
Limits used by all meshlet builders.
MeshletSizes
Used prefixes after caller-buffer meshlet construction.
Meshlets
The source-compatible u32 form of MeshletsGeneric. Complete tightly packed meshlet output.
MeshletsGeneric
Complete tightly packed meshlet output.
OpacityMapMeasure
Output of upstream meshopt_opacityMapMeasure.
OrientReport
Orientation changes and residuals; not in C++ meshoptimizer.
OrientedMesh
The source-compatible u32 form of OrientedMeshGeneric. Oriented indices with original face order; not in C++ meshoptimizer.
OrientedMeshGeneric
Oriented indices with original face order; not in C++ meshoptimizer.
OverdrawStatistics
Result of meshopt_analyzeOverdraw.
Partitions
Cluster-to-partition assignments in upstream order.
Positions
Checked borrowed XYZ view, preserving all supplied vertices, including unused ones.
PositionsMut
Checked mutable positions for destructive update simplification.
ProcessClusters
Cluster output with its builder-owned positions, not in C++ meshoptimizer. Cluster indices reference this array. Dilation can change it independently of the optimized level’s complete vertex records.
ProcessError
Stage failure, not in C++ meshoptimizer. No partial output is returned.
ProcessLevel
One optimized level, not in C++ meshoptimizer.
ProcessOptions
Pipeline settings, not in C++ meshoptimizer. Default: sanitize, weld complete records, two successive LODs at 50%/25% with 1% error, cache/overdraw (1.05)/fetch, and sampled LOD quality. Repair, meshlets, clusters and encoding are opt-in.
ProcessReport
Whole-call report, not in C++ meshoptimizer.
ProcessSkin
Skin fields within each complete vertex record, not in C++ meshoptimizer.
ProcessStageReport
Machine-readable stage measurement, not in C++ meshoptimizer.
ProcessedMesh
Atomic pipeline output, not in C++ meshoptimizer.
ProvokingMesh
The source-compatible u32 form of ProvokingMeshGeneric. Unique first-corner indices and source vertices for provoking-vertex rendering.
ProvokingMeshGeneric
Unique first-corner indices and source vertices for provoking-vertex rendering.
SanitizeOptions
Options for sanitize. Not in C++ meshoptimizer.
SanitizeReport
Triangle counts from sanitize or sanitize_into. Not in C++ meshoptimizer.
SanitizedMesh
The source-compatible u32 form of SanitizedMeshGeneric. Cleaned triangle list from sanitize. Not in C++ meshoptimizer.
SanitizedMeshGeneric
Cleaned triangle list from sanitize. Not in C++ meshoptimizer.
SimplifiedMesh
The source-compatible u32 form of SimplifiedMeshGeneric. Simplified topology referencing the original vertex array.
SimplifiedMeshGeneric
Simplified topology referencing the original vertex array.
SimplifyOptions
Stable simplification options supported by this port.
SimplifyResult
Caller-buffer simplification result.
SimplifySettings
Parameters for edge-collapse simplification.
SplitVerticesReport
Fan split counts; not in C++ meshoptimizer.
StitchReport
Stitch decisions; not in C++ meshoptimizer.
TopologyRepairGeneric
Repaired indices and packed attribute records; not in C++ meshoptimizer.
TrimmedCards
The source-compatible u32 form of TrimmedCardsGeneric. Trimmed vertex and index buffers. Not in C++ meshoptimizer.
TrimmedCardsGeneric
Trimmed vertex and index buffers. Not in C++ meshoptimizer.
Usage
Resource measurements for the most recent algorithm call.
VertexCacheStatistics
Result of upstream meshopt_analyzeVertexCache.
VertexFetchStatistics
Result of upstream meshopt_analyzeVertexFetch.
VertexFieldSnapshot
Owned field snapshot exposing existing views, not in C++ meshoptimizer.
VertexFlags
Independent upstream simplification vertex flags; unknown bits are rejected.
VertexLayout
Checked float-array field layout, not in C++ meshoptimizer.
VertexRemap
A compact vertex numbering; unused vertices retain u32::MAX.
VertexScoreTable
Caller-defined vertex-cache scores; an opt-in extension not in C++ meshoptimizer.
VertexStream
Initialized byte records used as binary equality keys. Supplied padding is part of equality; no typed object is reinterpreted as bytes.
VisibleMesh
The source-compatible u32 form of VisibleMeshGeneric. Filtered mesh in original triangle order. Not in C++ meshoptimizer.
VisibleMeshGeneric
Filtered mesh in original triangle order. Not in C++ meshoptimizer.
WeldReport
Counts from welding; not in C++ meshoptimizer.
WeldedVertices
Old-to-original-representative mapping; not in C++ meshoptimizer.
Workspace
Reusable fallibly allocated scratch storage and per-call resource limits.

Enums§

AlphaWrap
Texel lookup outside 0..width and 0..height. Not in C++ meshoptimizer.
ByteOrder
Explicit byte order of floating-point components in byte-backed views.
CharacterLodMethod
Winning method in best-of selection; not in C++ meshoptimizer.
Error
Checked input, resource, allocation, or numerical failure.
HiddenViews
Views for hidden-surface removal. Not in C++ meshoptimizer. Surfaces occlude from both sides; winding does not affect visibility.
ImpostorAlbedo
Surface colour and alpha source. Not in C++ meshoptimizer.
ImpostorLayout
Direction set covered by the view grid. Not in C++ meshoptimizer.
LodErrors
A single error cap or one cap per level, in the units selected by the simplifier options.
LodTargets
Level targets, expressed as index counts or fractions of the source index count.
ProcessStage
A pipeline operation, not in C++ meshoptimizer.
Retention
Policy for retaining reusable algorithm scratch between calls.
VertexLayoutError
A construction failure for a typed vertex layout or snapshot.
WeldPolicy
Explicit seam policy for welding; not in C++ meshoptimizer.

Constants§

REMESH_SHELL
Produce a two-sided surface shell.
REMESH_SOLVE
Solve the output positions using accumulated quadrics.
TANGENT_COMPATIBLE
Preserve MikkTSpace weighting instead of upstream’s area-weighted default.
TANGENT_ZERO_FALLBACK
Emit zero tangents for isolated degenerate faces.

Traits§

Index
A vertex index stored as u16 or u32.

Functions§

analyze_coverage
The source-compatible u32 entry point; see analyze_coverage_generic for selectable index widths.
analyze_coverage_generic
Analyze projected coverage on three axes with the upstream rasterizer.
analyze_mesh
The source-compatible u32 entry point; see analyze_mesh_generic for selectable index widths.
analyze_mesh_generic
Report the topology of a triangle list without changing anything. Not in C++ meshoptimizer.
analyze_overdraw
The source-compatible u32 entry point; see analyze_overdraw_generic for selectable index widths.
analyze_overdraw_generic
Analyze raster overdraw with upstream’s 256-pixel viewport model.
analyze_vertex_cache
The source-compatible u32 entry point; see analyze_vertex_cache_generic for selectable index widths.
analyze_vertex_cache_generic
Analyze a triangle list using upstream’s simplified FIFO transform cache.
analyze_vertex_fetch
The source-compatible u32 entry point; see analyze_vertex_fetch_generic for selectable index widths.
analyze_vertex_fetch_generic
Analyze index order with upstream’s direct-mapped 128 KiB fetch-cache model.
bake_impostor
The u32 entry point; see bake_impostor_generic for selectable index widths.
bake_impostor_generic
Bake an octahedral impostor atlas. Not in C++ meshoptimizer.
build_character_lod_chain
Build character LODs and LOD quality reports in bind, full blend, and caller joint poses. This extension is not in C++ meshoptimizer. Joint poses use linear blend skinning of rest positions. Blend targets and joint poses are sampled separately; combined morph/animation extrema are not implied. Quality is sampled, not a bound. Limits cover the whole call. Failure returns no partial chain.
build_lod_chain
The source-compatible u32 entry point; see build_lod_chain_generic for selectable index widths.
build_lod_chain_generic
Build a LOD chain. This extension is not in C++ meshoptimizer.
build_meshlets
The source-compatible u32 entry point; see build_meshlets_generic for selectable index widths.
build_meshlets_bound
meshopt_buildMeshletsBound: conservative descriptor capacity, with checked arithmetic.
build_meshlets_flex
The source-compatible u32 entry point; see build_meshlets_flex_generic for selectable index widths.
build_meshlets_flex_generic
meshopt_buildMeshletsFlex: variable triangle counts and optional spatial splits.
build_meshlets_flex_into
The source-compatible u32 entry point; see build_meshlets_flex_into_generic for selectable index widths.
build_meshlets_flex_into_generic
Caller-buffer flexible builder; a late failure may modify output prefixes.
build_meshlets_generic
meshopt_buildMeshlets: connectivity and cone-aware meshlets.
build_meshlets_into
The source-compatible u32 entry point; see build_meshlets_into_generic for selectable index widths.
build_meshlets_into_generic
Caller-buffer standard builder; a late failure may modify output prefixes.
build_meshlets_scan
The source-compatible u32 entry point; see build_meshlets_scan_generic for selectable index widths.
build_meshlets_scan_generic
meshopt_buildMeshletsScan: consume triangles in input order.
build_meshlets_scan_into
The source-compatible u32 entry point; see build_meshlets_scan_into_generic for selectable index widths.
build_meshlets_scan_into_generic
Caller-buffer scan builder; a late work-limit failure may modify output prefixes.
build_meshlets_spatial
The source-compatible u32 entry point; see build_meshlets_spatial_generic for selectable index widths.
build_meshlets_spatial_generic
meshopt_buildMeshletsSpatial: surface-area heuristic meshlets for ray tracing.
build_meshlets_spatial_into
The source-compatible u32 entry point; see build_meshlets_spatial_into_generic for selectable index widths.
build_meshlets_spatial_into_generic
Caller-buffer spatial builder; a late failure may modify output prefixes.
compute_cluster_bounds
The source-compatible u32 entry point; see compute_cluster_bounds_generic for selectable index widths.
compute_cluster_bounds_generic
meshopt_computeClusterBounds: sphere and conservative normal cone.
compute_cluster_bounds_with_positions
The source-compatible u32 entry point; see compute_cluster_bounds_with_positions_generic for selectable index widths.
compute_cluster_bounds_with_positions_generic
Compute cluster bounds using a cached positions-validation scan.
compute_meshlet_bounds
The source-compatible u32 entry point; see compute_meshlet_bounds_generic for selectable index widths.
compute_meshlet_bounds_generic
meshopt_computeMeshletBounds: bounds of byte-local triangles.
compute_meshlet_bounds_with_positions
The source-compatible u32 entry point; see compute_meshlet_bounds_with_positions_generic for selectable index widths.
compute_meshlet_bounds_with_positions_generic
Compute meshlet bounds using a cached positions-validation scan.
compute_position_exponent
Compute the exponent of a conservative signed position grid. Bounds must be finite and ordered; min_exp is at least -126 and max_bits is 2 through 24. Overflowing scaled bounds return an error.
compute_sphere_bounds
meshopt_computeSphereBounds. Optional radii use a checked one-component view.
dequantize_half
Expand a half value; flush half subnormals, preserve signed zero and NaN payloads.
extract_meshlet_indices
The source-compatible u32 entry point; see extract_meshlet_indices_generic for selectable index widths.
extract_meshlet_indices_generic
meshopt_extractMeshletIndices: preserve first-visit vertex order.
extract_meshlet_indices_into
The source-compatible u32 entry point; see extract_meshlet_indices_into_generic for selectable index widths.
extract_meshlet_indices_into_generic
Caller-buffer extraction. Errors leave both destinations unchanged; tails are preserved.
fill_holes
The source-compatible u32 entry point; see fill_holes_generic for selectable index widths.
fill_holes_bound
Conservative output index bound for fill_holes_into; not in C++ meshoptimizer. Each boundary edge contributes at most three added indices.
fill_holes_generic
Fill small simple boundary loops with existing vertices only. Not in C++ meshoptimizer. max_edges is inclusive; values below three fill nothing. Original triangles and vertex streams are unchanged.
fill_holes_into
The source-compatible u32 entry point; see fill_holes_into_generic for selectable index widths.
fill_holes_into_generic
fill_holes into caller storage; not in C++ meshoptimizer. Writes report.output_triangles * 3 indices and preserves the tail. A destination of fill_holes_bound entries suffices. All errors, including insufficient capacity, leave the entire destination unchanged. Added faces and reports are staged in budgeted heap storage before any write.
filter_index_buffer
The source-compatible u32 entry point; see filter_index_buffer_generic for selectable index widths.
filter_index_buffer_generic
Remove binary-degenerate and duplicate triangles; preserve surviving source corners and winding. Rotated duplicates are removed; reversed winding stays.
filter_index_buffer_into
The source-compatible u32 entry point; see filter_index_buffer_into_generic for selectable index widths.
filter_index_buffer_into_generic
Caller-buffer filtering. The tail is preserved; work exhaustion can leave partial output.
filter_index_buffer_multi
The source-compatible u32 entry point; see filter_index_buffer_multi_generic for selectable index widths.
filter_index_buffer_multi_generic
Multi-stream triangle filtering.
filter_index_buffer_multi_into
The source-compatible u32 entry point; see filter_index_buffer_multi_into_generic for selectable index widths.
filter_index_buffer_multi_into_generic
Caller-buffer multi-stream filtering; late work exhaustion can leave partial output.
generate_adjacency_index_buffer
The source-compatible u32 entry point; see generate_adjacency_index_buffer_generic for selectable index widths.
generate_adjacency_index_buffer_generic
Generate six adjacency indices per triangle using binary position welding.
generate_adjacency_index_buffer_into
The source-compatible u32 entry point; see generate_adjacency_index_buffer_into_generic for selectable index widths.
generate_adjacency_index_buffer_into_generic
Caller-buffer adjacency; requires twice input-length capacity. Late work exhaustion can leave partial output.
generate_normals
The source-compatible u32 entry point; see generate_normals_generic for selectable index widths.
generate_normals_generic
Experimental upstream meshopt_generateNormals, exposed only with experimental. None indices denote an unindexed triangle list.
generate_normals_into
The source-compatible u32 entry point; see generate_normals_into_generic for selectable index widths.
generate_normals_into_generic
Caller-buffer form of the experimental normal generator. The destination is unchanged if validation or allocation fails.
generate_position_remap
The source-compatible u32 entry point; see generate_position_remap_generic for selectable index widths.
generate_position_remap_generic
Map each position to its first numerically equal vertex. Signed zeros weld; NaNs do not compare equal. The output refers to original indices.
generate_position_remap_into
The source-compatible u32 entry point; see generate_position_remap_into_generic for selectable index widths.
generate_position_remap_into_generic
Caller-buffer numerical position remap. The tail is preserved; work exhaustion can leave partial output.
generate_provoking_index_buffer
The source-compatible u32 entry point; see generate_provoking_index_buffer_generic for selectable index widths.
generate_provoking_index_buffer_generic
Generate a unique first-corner vertex for each triangle, with the same wrapping eight-bit valence heuristic and cyclic rotations as upstream.
generate_provoking_index_buffer_into
The source-compatible u32 entry point; see generate_provoking_index_buffer_into_generic for selectable index widths.
generate_provoking_index_buffer_into_generic
Write provoking topology and used reorder prefix. Requires vertex-count plus triangle-count reorder capacity; work exhaustion can partially modify both outputs.
generate_shadow_index_buffer
The source-compatible u32 entry point; see generate_shadow_index_buffer_generic for selectable index widths.
generate_shadow_index_buffer_generic
Replace triangle references with first referenced binary-equal vertices.
generate_shadow_index_buffer_into
The source-compatible u32 entry point; see generate_shadow_index_buffer_into_generic for selectable index widths.
generate_shadow_index_buffer_into_generic
Caller-buffer shadow indices; late work exhaustion can leave partial output.
generate_shadow_index_buffer_multi
The source-compatible u32 entry point; see generate_shadow_index_buffer_multi_generic for selectable index widths.
generate_shadow_index_buffer_multi_generic
Multi-stream shadow indices, preserving original vertex numbering.
generate_shadow_index_buffer_multi_into
The source-compatible u32 entry point; see generate_shadow_index_buffer_multi_into_generic for selectable index widths.
generate_shadow_index_buffer_multi_into_generic
Caller-buffer multi-stream shadow indices; late work exhaustion can leave partial output.
generate_tangents
The source-compatible u32 entry point; see generate_tangents_generic for selectable index widths.
generate_tangents_generic
Generate per-corner XYZ plus handedness, matching meshopt_generateTangents. None indices denote an unindexed triangle list. Normals and UVs are packed.
generate_tangents_into
The source-compatible u32 entry point; see generate_tangents_into_generic for selectable index widths.
generate_tangents_into_generic
Caller-buffer form of meshopt_generateTangents; writes one vector per corner. The destination is unchanged if validation or allocation fails.
generate_tessellation_index_buffer
The source-compatible u32 entry point; see generate_tessellation_index_buffer_generic for selectable index widths.
generate_tessellation_index_buffer_generic
Generate twelve tessellation indices per triangle using binary position welding.
generate_tessellation_index_buffer_into
The source-compatible u32 entry point; see generate_tessellation_index_buffer_into_generic for selectable index widths.
generate_tessellation_index_buffer_into_generic
Caller-buffer tessellation; requires four times input-length capacity. Late work exhaustion can leave partial output.
generate_vertex_remap
The source-compatible u32 entry point; see generate_vertex_remap_generic for selectable index widths.
generate_vertex_remap_custom
The source-compatible u32 entry point; see generate_vertex_remap_custom_generic for selectable index widths.
generate_vertex_remap_custom_generic
Generate compact numbering with a callback invoked only for numerically equal positions, in exactly upstream’s hash-probe order. Signed zeros weld.
generate_vertex_remap_custom_into
The source-compatible u32 entry point; see generate_vertex_remap_custom_into_generic for selectable index widths.
generate_vertex_remap_custom_into_generic
Caller-buffer custom numbering with exact callback traversal. Work exhaustion can leave partial output.
generate_vertex_remap_generic
Generate compact numbering from tightly packed binary keys. None visits every vertex in original order; indexed input need not be a triangle list.
generate_vertex_remap_into
The source-compatible u32 entry point; see generate_vertex_remap_into_generic for selectable index widths.
generate_vertex_remap_into_generic
Single-stream caller-buffer compact numbering.
generate_vertex_remap_multi
The source-compatible u32 entry point; see generate_vertex_remap_multi_generic for selectable index widths.
generate_vertex_remap_multi_generic
Generate compact numbering from one through sixteen initialized key streams.
generate_vertex_remap_multi_into
The source-compatible u32 entry point; see generate_vertex_remap_multi_into_generic for selectable index widths.
generate_vertex_remap_multi_into_generic
Generate compact numbering into caller storage. The tail is untouched; work exhaustion may leave the used prefix partially modified.
impostor_switch_distance
Recommend the distance from which an impostor may replace the mesh. Not in C++ meshoptimizer.
measure_lod_chain_quality
The source-compatible u32 entry point; see measure_lod_chain_quality_generic for selectable index widths.
measure_lod_chain_quality_generic
Measure every build_lod_chain level directly against source using its unchanged vertex/normal buffers. Limits cover the entire call, including the returned metadata. An empty chain returns an empty vector. Not in C++ meshoptimizer. Thresholds follow measured errors and are not forced to increase: independent simplifications can have nonmonotone error.
measure_lod_quality
The source-compatible u32 entry point; see measure_lod_quality_generic for selectable index widths.
measure_lod_quality_generic
Measure a source and a simplified surface, with a balanced triangle BVH. This extension is not in C++ meshoptimizer and does not change simplification.
opacity_map_compact
Compact OMM data in place, as upstream meshopt_opacityMapCompact does.
opacity_map_entry_size
Packed byte count for one micromap, corresponding to meshopt_opacityMapEntrySize.
opacity_map_measure
The source-compatible u32 entry point; see opacity_map_measure_generic for selectable index widths.
opacity_map_measure_generic
Deduplicate triangles by quantized UV and choose adaptive OMM levels.
opacity_map_measure_into
The source-compatible u32 entry point; see opacity_map_measure_into_generic for selectable index widths.
opacity_map_measure_into_generic
Caller-buffer form of meshopt_opacityMapMeasure; returns unique entry count. The three destinations are unchanged when validation fails.
opacity_map_rasterize
Rasterize one upstream opacity entry using an alpha-channel byte view.
opacity_map_rasterize_into
Caller-buffer form of meshopt_opacityMapRasterize. Returns the number of bytes written and preserves the destination on error.
optimize_meshlet
The source-compatible u32 entry point; see optimize_meshlet_generic for selectable index widths.
optimize_meshlet_generic
Allocating meshopt_optimizeMeshlet (level zero).
optimize_meshlet_in_place
The source-compatible u32 entry point; see optimize_meshlet_in_place_generic for selectable index widths.
optimize_meshlet_in_place_generic
Atomic destructive meshopt_optimizeMeshlet (level zero).
optimize_meshlet_into
The source-compatible u32 entry point; see optimize_meshlet_into_generic for selectable index widths.
optimize_meshlet_into_generic
Caller-buffer level-zero meshlet optimization, preserving unused tails.
optimize_meshlet_level
The source-compatible u32 entry point; see optimize_meshlet_level_generic for selectable index widths.
optimize_meshlet_level_generic
Allocating meshopt_optimizeMeshletLevel; unused vertex suffix stays unchanged.
optimize_meshlet_level_in_place
The source-compatible u32 entry point; see optimize_meshlet_level_in_place_generic for selectable index widths.
optimize_meshlet_level_in_place_generic
meshopt_optimizeMeshletLevel: atomic destructive variant, levels 0 through 9.
optimize_meshlet_level_into
The source-compatible u32 entry point; see optimize_meshlet_level_into_generic for selectable index widths.
optimize_meshlet_level_into_generic
Caller-buffer meshlet optimization. Errors leave destinations unchanged; suffixes beyond the supplied vertex and triangle lengths are preserved.
optimize_overdraw
The source-compatible u32 entry point; see optimize_overdraw_generic for selectable index widths.
optimize_overdraw_generic
Reorder cache-optimized triangles using upstream meshopt_optimizeOverdraw.
optimize_overdraw_in_place
The source-compatible u32 entry point; see optimize_overdraw_in_place_generic for selectable index widths.
optimize_overdraw_in_place_generic
Destructively apply upstream overdraw ordering, leaving input unchanged on error. A fallibly allocated temporary output counts toward the byte limit.
optimize_overdraw_into
The source-compatible u32 entry point; see optimize_overdraw_into_generic for selectable index widths.
optimize_overdraw_into_generic
Write upstream overdraw ordering to the used prefix of a caller buffer.
optimize_vertex_cache
The source-compatible u32 entry point; see optimize_vertex_cache_generic for selectable index widths.
optimize_vertex_cache_fifo
The source-compatible u32 entry point; see optimize_vertex_cache_fifo_generic for selectable index widths.
optimize_vertex_cache_fifo_generic
Optimize using upstream’s FIFO cache heuristic. Cache size is at least three.
optimize_vertex_cache_fifo_in_place
The source-compatible u32 entry point; see optimize_vertex_cache_fifo_in_place_generic for selectable index widths.
optimize_vertex_cache_fifo_in_place_generic
Destructively apply FIFO ordering, preserving indices on error.
optimize_vertex_cache_fifo_into
The source-compatible u32 entry point; see optimize_vertex_cache_fifo_into_generic for selectable index widths.
optimize_vertex_cache_fifo_into_generic
Write FIFO cache ordering; work exhaustion may partially modify the prefix.
optimize_vertex_cache_generic
Reorder triangles using upstream meshopt_optimizeVertexCache (standard variant).
optimize_vertex_cache_in_place
The source-compatible u32 entry point; see optimize_vertex_cache_in_place_generic for selectable index widths.
optimize_vertex_cache_in_place_generic
Destructively apply upstream standard cache ordering, leaving input unchanged on error. A fallibly allocated temporary output counts toward the byte limit.
optimize_vertex_cache_into
The source-compatible u32 entry point; see optimize_vertex_cache_into_generic for selectable index widths.
optimize_vertex_cache_into_generic
Write upstream standard cache ordering to the used prefix of destination.
optimize_vertex_cache_strip
The source-compatible u32 entry point; see optimize_vertex_cache_strip_generic for selectable index widths.
optimize_vertex_cache_strip_generic
Optimize cache ordering using upstream’s strip-oriented score table.
optimize_vertex_cache_strip_in_place
The source-compatible u32 entry point; see optimize_vertex_cache_strip_in_place_generic for selectable index widths.
optimize_vertex_cache_strip_in_place_generic
Destructively apply strip-oriented ordering, preserving indices on error.
optimize_vertex_cache_strip_into
The source-compatible u32 entry point; see optimize_vertex_cache_strip_into_generic for selectable index widths.
optimize_vertex_cache_strip_into_generic
Write strip-oriented cache ordering; work exhaustion may partially modify the used prefix. The unused destination tail is untouched.
optimize_vertex_cache_with_table
The source-compatible u32 entry point; see optimize_vertex_cache_with_table_generic for selectable index widths.
optimize_vertex_cache_with_table_generic
Reorder triangles with caller-defined scores; not in C++ meshoptimizer.
optimize_vertex_cache_with_table_into
The source-compatible u32 entry point; see optimize_vertex_cache_with_table_into_generic for selectable index widths.
optimize_vertex_cache_with_table_into_generic
Write caller-defined cache ordering; not in C++ meshoptimizer.
optimize_vertex_fetch
The source-compatible u32 entry point; see optimize_vertex_fetch_generic for selectable index widths.
optimize_vertex_fetch_generic
Allocate first-use vertex bytes and rewritten arbitrary indices.
optimize_vertex_fetch_in_place
Explicit destructive spelling for caller-buffer fetch optimization. This is the same checked operation as optimize_vertex_fetch_into. The source-compatible u32 entry point; see optimize_vertex_fetch_into_generic for selectable index widths.
optimize_vertex_fetch_in_place_generic
Selectable index-width fetch optimization. Write fetch-ordered bytes while rewriting indices in place. Validation and allocation precede writes; counted-work exhaustion may modify both buffers.
optimize_vertex_fetch_into
The source-compatible u32 entry point; see optimize_vertex_fetch_into_generic for selectable index widths.
optimize_vertex_fetch_into_generic
Write fetch-ordered bytes while rewriting indices in place. Validation and allocation precede writes; counted-work exhaustion may modify both buffers.
optimize_vertex_fetch_remap
The source-compatible u32 entry point; see optimize_vertex_fetch_remap_generic for selectable index widths.
optimize_vertex_fetch_remap_generic
Generate first-use fetch numbering for an arbitrary index sequence.
optimize_vertex_fetch_remap_into
The source-compatible u32 entry point; see optimize_vertex_fetch_remap_into_generic for selectable index widths.
optimize_vertex_fetch_remap_into_generic
Fetch numbering into caller storage. Unused vertices are u32::MAX; work exhaustion may partially modify the used prefix.
optimize_vertex_fetch_remap_with_indices
The source-compatible u32 entry point; see optimize_vertex_fetch_remap_with_indices_generic for selectable index widths.
optimize_vertex_fetch_remap_with_indices_generic
Generate first-use fetch numbering using cached index validation.
optimize_vertex_fetch_remap_with_indices_into
The source-compatible u32 entry point; see optimize_vertex_fetch_remap_with_indices_into_generic for selectable index widths.
optimize_vertex_fetch_remap_with_indices_into_generic
Generate fetch numbering into caller storage using cached validation.
orient_faces
The source-compatible u32 entry point; see orient_faces_generic for selectable index widths.
orient_faces_bound
Index count required by orient_faces_into; not in C++ meshoptimizer.
orient_faces_generic
Propagate winding across edges with exactly two incident faces. Not in C++ meshoptimizer. Each component is seeded by its lowest face index, which stays unflipped. Breadth-first visits use original corner order. Non-manifold edges never provide adjacency or orientation constraints; their incident components are reported as ambiguous. A face incident to such an edge can still flip due to a different, two-face edge. Contradictory components retain their deterministic spanning-tree assignment and report the residual conflict edges. No outward orientation is attempted.
orient_faces_into
The source-compatible u32 entry point; see orient_faces_into_generic for selectable index widths.
orient_faces_into_generic
orient_faces into caller storage; not in C++ meshoptimizer. Writes the input index count, preserves the tail, and leaves all destination entries unchanged on every error. Reports also use budgeted heap storage.
partition_clusters
The source-compatible u32 entry point; see partition_clusters_generic for selectable index widths.
partition_clusters_generic
meshopt_partitionClusters. Clusters may contain arbitrary index lists; empty clusters are invalid. Positions are optional; without them only connected clusters merge.
partition_clusters_into
The source-compatible u32 entry point; see partition_clusters_into_generic for selectable index widths.
partition_clusters_into_generic
Caller-buffer cluster partitioning; a late failure may modify the used prefix.
process_mesh
Run the common asset path on complete tightly packed little-endian records. This extension is not in C++ meshoptimizer. Position offset addresses three f32s. Record size is 12..=256 bytes. All attributes (including skin) participate in binary welding; padding must be initialized deterministically. Attribute/skin offsets are preserved through remapping and fetch. Source level is always included.
quantize_float
Round to 0 through 23 mantissa bits. Preserve infinity and NaN payloads; flush all exponent-zero values, including negative zero, to positive zero.
quantize_half
Convert to upstream’s half representation, flushing subnormals and canonicalizing NaNs to signed quiet NaNs.
quantize_snorm
Quantize to a signed normalized integer with 1 through 31 bits. Infinities clamp; NaN follows upstream comparisons and becomes the minimum.
quantize_unorm
Quantize to an unsigned normalized integer with 0 through 30 bits. Infinities clamp; NaN follows upstream comparisons and becomes zero.
remap_index_buffer
The source-compatible u32 entry point; see remap_index_buffer_generic for selectable index widths.
remap_index_buffer_generic
Allocate remapped indices.
remap_index_buffer_into
The source-compatible u32 entry point; see remap_index_buffer_into_generic for selectable index widths.
remap_index_buffer_into_generic
Remap arbitrary index sequences. None remaps all vertices in order; references to the unused sentinel are rejected before writes.
remap_vertex_buffer
Allocate remapped tightly packed bytes, zero-initializing unmapped records.
remap_vertex_buffer_into
Remap initialized vertex bytes into caller storage. Repeated destinations use the last source record, matching upstream; unmapped records are untouched. Validation precedes writes; work exhaustion may leave partial output.
remesh
The source-compatible u32 entry point; see remesh_generic for selectable index widths.
remesh_bound
The source-compatible u32 entry point; see remesh_bound_generic for selectable index widths.
remesh_bound_generic
Return the upstream triangle-count upper bound with no output allocation.
remesh_generic
Allocate the upper bound, remesh, and return three vertices per output triangle.
remesh_into
The source-compatible u32 entry point; see remesh_into_generic for selectable index widths.
remesh_into_generic
Write up to destination.len()/3 triangles and return the full triangle count. A short destination receives a prefix, matching upstream’s partial-write rule.
remove_hidden_triangles
The source-compatible u32 entry point; see remove_hidden_triangles_generic for selectable index widths.
remove_hidden_triangles_generic
Remove hidden triangles using deterministic software item buffers (outside views) or BVH ray casts (finite viewpoints). Not in C++ meshoptimizer.
remove_hidden_triangles_into
The source-compatible u32 entry point; see remove_hidden_triangles_into_generic for selectable index widths.
remove_hidden_triangles_into_generic
remove_hidden_triangles into caller storage. Not in C++ meshoptimizer. At most indices.len() entries are written. Every error leaves the entire destination unchanged; success writes HiddenReport::index_count entries and preserves the tail. Options, sampling and errors are identical to the owned form, with BufferTooSmall when the retained indices do not fit.
sanitize
The source-compatible u32 entry point; see sanitize_generic for selectable index widths.
sanitize_bound
Upper bound on the indices sanitize_into writes: the input index count. Not in C++ meshoptimizer. The exact count is SanitizeReport::index_count of a previous call with the same input.
sanitize_generic
Remove invalid, degenerate and duplicate triangles from a triangle list. Not in C++ meshoptimizer.
sanitize_into
The source-compatible u32 entry point; see sanitize_into_generic for selectable index widths.
sanitize_into_generic
sanitize into caller storage. Not in C++ meshoptimizer.
simplify
The source-compatible u32 entry point; see simplify_generic for selectable index widths.
simplify_character
Simplify with exact dense bone-weight and full blend-target position channels. This extension is not in C++ meshoptimizer. The summed attribute energy is a pose-aware surrogate, not a maximum-pose geometric error guarantee. Bone IDs are channel identities, never numeric attributes. Influence order is irrelevant except for floating-point summation of duplicates. No streams are rewritten. Exact channels (bone count + 3 * blend count) are bounded by workspace memory and work limits, never projected or truncated. Public attribute constructors retain their 32-component limit. Empty deformation inputs use plain simplify.
simplify_generic
Allocate meshopt_simplify’s result, preserving upstream ordering and error bits. No welding, fetch compaction or cache optimization is applied to the result.
simplify_into
The source-compatible u32 entry point; see simplify_into_generic for selectable index widths.
simplify_into_generic
Write meshopt_simplify’s result into a caller buffer of at least input length. The tail after the input length is preserved. A late resource or numerical error may modify the input-length prefix; use the allocating API for atomicity.
simplify_points
The source-compatible u32 entry point; see simplify_points_generic for selectable index widths.
simplify_points_generic
Simplify points to original vertex indices using grid reservoirs. Optional colors are checked three-component views; all supplied values must be finite.
simplify_points_into
The source-compatible u32 entry point; see simplify_points_into_generic for selectable index widths.
simplify_points_into_generic
Caller-buffer point reduction. Requires target-count capacity; work exhaustion may partially modify output.
simplify_prune
The source-compatible u32 entry point; see simplify_prune_generic for selectable index widths.
simplify_prune_generic
Remove disconnected components whose bounding-sphere radius is at most the relative error. Position welding is numerical, including signed zeros; unused positions affect bounds.
simplify_prune_into
The source-compatible u32 entry point; see simplify_prune_into_generic for selectable index widths.
simplify_prune_into_generic
Caller-buffer component pruning. Requires input-length capacity; work exhaustion may partially modify output.
simplify_scale
Return meshopt_simplifyScale’s maximum axis extent, without an epsilon clamp. Empty and coincident positions return zero; non-finite inputs and overflowing extents return an error. This operation allocates no memory.
simplify_sloppy
The source-compatible u32 entry point; see simplify_sloppy_generic for selectable index widths.
simplify_sloppy_generic
Grid-based sloppy triangle simplification. Only LOCK flags are accepted; target error and returned error are relative to the full position extent.
simplify_sloppy_into
The source-compatible u32 entry point; see simplify_sloppy_into_generic for selectable index widths.
simplify_sloppy_into_generic
Caller-buffer sloppy simplification. Requires input-length capacity; work exhaustion may partially modify output.
simplify_with_attributes
The source-compatible u32 entry point; see simplify_with_attributes_generic for selectable index widths.
simplify_with_attributes_generic
Allocate meshopt_simplifyWithAttributes’s result. All three vertex flags are supported; weights must be finite and nonnegative, with one per component. Zero-weight components do not contribute to error. All supplied values must be finite, including unused vertices and zero-weight components.
simplify_with_attributes_into
The source-compatible u32 entry point; see simplify_with_attributes_into_generic for selectable index widths.
simplify_with_attributes_into_generic
Caller-buffer attribute simplification, with the same contracts as simplify_with_attributes and the mutation guarantee of simplify_into.
simplify_with_update
The source-compatible u32 entry point; see simplify_with_update_generic for selectable index widths.
simplify_with_update_generic
Destructively simplify indices and solve surviving positions and weighted attributes. Late work or numerical failures may modify the index prefix; position and attribute writes start only after solving completes. Unused vertices, externally locked vertices and zero-weight attributes are preserved.
simplify_with_update_in_place
Explicit destructive spelling for update simplification with mutable views. This is the same checked operation as simplify_with_update. The source-compatible u32 entry point; see simplify_with_update_generic for selectable index widths.
simplify_with_update_in_place_generic
Selectable index-width update simplification. Destructively simplify indices and solve surviving positions and weighted attributes. Late work or numerical failures may modify the index prefix; position and attribute writes start only after solving completes. Unused vertices, externally locked vertices and zero-weight attributes are preserved.
spatial_cluster_points
The source-compatible u32 entry point; see spatial_cluster_points_generic for selectable index widths.
spatial_cluster_points_generic
meshopt_spatialClusterPoints: new-to-old permutation in fixed-size clusters.
spatial_cluster_points_into
The source-compatible u32 entry point; see spatial_cluster_points_into_generic for selectable index widths.
spatial_cluster_points_into_generic
Caller-buffer point clustering; the unused tail is preserved.
spatial_sort_remap
The source-compatible u32 entry point; see spatial_sort_remap_generic for selectable index widths.
spatial_sort_remap_generic
meshopt_spatialSortRemap: old-to-new Morton remap.
spatial_sort_remap_into
The source-compatible u32 entry point; see spatial_sort_remap_into_generic for selectable index widths.
spatial_sort_remap_into_generic
Caller-buffer Morton remap; the unused tail is preserved.
spatial_sort_triangles
The source-compatible u32 entry point; see spatial_sort_triangles_generic for selectable index widths.
spatial_sort_triangles_generic
meshopt_spatialSortTriangles: reorder complete triangles by centroid Morton order.
spatial_sort_triangles_in_place
The source-compatible u32 entry point; see spatial_sort_triangles_in_place_generic for selectable index widths.
spatial_sort_triangles_in_place_generic
Atomic in-place spatial triangle sorting.
spatial_sort_triangles_into
The source-compatible u32 entry point; see spatial_sort_triangles_into_generic for selectable index widths.
spatial_sort_triangles_into_generic
Caller-buffer spatial triangle sorting; the unused tail is preserved.
split_non_manifold_vertices
Split disconnected face fans at each vertex, copying complete attribute records. This extension is not in C++ meshoptimizer. The first fan (lowest input corner) keeps its vertex; subsequent fans receive appended copies. Unused vertices remain. A fan is a set of corners joined across shared edges, the definition analyze_mesh uses, so afterwards non_manifold_vertices is zero. Edges shared by more than two faces stay shared and are not repaired. Work and storage are bounded by the workspace, with no partial output.
split_non_manifold_vertices_generic
Selectable index form of split_non_manifold_vertices; not in C++ meshoptimizer.
stitch_cracks
Stitch boundary vertices and subdivide boundary edges at T-junctions. Not in C++ meshoptimizer. None selects 1e-6 times the largest bounds extent; Some is an absolute finite nonnegative Euclidean tolerance. Only boundary vertices participate. Lowest original vertex wins each merge; attributes of that representative win, so this is an explicit position-only seam policy. Records stay packed and uncompact, and T-junctions reuse existing records. Every candidate must keep a positive normal dot product on each changed face and must not increase the mesh’s counts of edges with more than two faces, equally directed two-face edges, or surplus vertex fans. Other candidates are counted as refusals. Defects present in the input do not block other stitches. A deterministic sorted spatial grid finds vertex pairs; edge/vertex tests and whole-mesh validation are metered (worst-case quadratic or worse).
stitch_cracks_generic
Selectable index form of stitch_cracks; not in C++ meshoptimizer.
stripify
The source-compatible u32 entry point; see stripify_generic for selectable index widths.
stripify_bound
Worst-case output index count for meshopt_stripify.
stripify_generic
Convert triangles to an exact upstream strip. A nonzero restart_index enables restarts.
stripify_into
The source-compatible u32 entry point; see stripify_into_generic for selectable index widths.
stripify_into_generic
Caller-buffer form of meshopt_stripify; destination needs the bound capacity.
trim_alpha_cards
The source-compatible u32 entry point; see trim_alpha_cards_generic for selectable index widths.
trim_alpha_cards_generic
Fit alpha-tested cards to their visible texels. Not in C++ meshoptimizer.
unstripify
The source-compatible u32 entry point; see unstripify_generic for selectable index widths.
unstripify_bound
Worst-case output index count for meshopt_unstripify.
unstripify_generic
Convert a strip to triangles, skipping degenerate triangles as upstream does.
unstripify_into
The source-compatible u32 entry point; see unstripify_into_generic for selectable index widths.
unstripify_into_generic
Caller-buffer form of meshopt_unstripify; destination needs the bound capacity.
validate_vertex_flags
Validate that optional vertex flags have exactly one entry per vertex.
weld_vertices
Weld positions within a finite nonnegative Euclidean distance tolerance. This extension is not in C++ meshoptimizer. No vertex is moved.
weld_vertices_bound
Mapping length required by weld_vertices_into; not in C++ meshoptimizer.
weld_vertices_into
The source-compatible u32 entry point; see weld_vertices_into_generic for selectable index widths.
weld_vertices_into_generic
weld_vertices into caller storage; not in C++ meshoptimizer. On success writes positions.len() entries and preserves the tail. Every error leaves the entire destination unchanged. Stages the mapping in budgeted scratch, so the caller-buffer form still requires heap storage.