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
-
Streaming index sequences (an extension, not in C++ meshoptimizer).
-
Mesh repair (an extension, not in C++ meshoptimizer).
-
LOD quality and switch distances (not in C++ meshoptimizer).
-
Hidden-surface removal (an extension, not in C++ meshoptimizer).
-
Alpha-cutout card trimming (an extension, not in C++ meshoptimizer).
-
Cluster LOD DAG files (an extension, not in C++ meshoptimizer).
-
Parallel vertex codec and spatial meshlets (an extension, not in C++ meshoptimizer).
-
Character LODs (an extension, not in C++ meshoptimizer).
-
One-call asset pipeline (an extension, not in C++ meshoptimizer).
-
Incremental vertex and triangle decoding (an extension, not in C++ meshoptimizer).
§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): implementsstd::error::ErrorforError. Disable default features forno_std; an allocator is still required.clusterlod: the cluster-LOD builder from upstream’sdemo/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; enablesstd. See theparallelmodule 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§
- Alpha
Mask - Read-only 8-bit alpha plane for
trim_alpha_cards. Not in C++ meshoptimizer. - Analysis
Lists - Bounded defect lists from
analyze_mesh. Not in C++ meshoptimizer. - Analyze
Options - Options for
analyze_mesh. Not in C++ meshoptimizer. - Attributes
- Checked borrowed attribute view with at most 32 components per vertex.
- Attributes
Mut - Checked mutable attribute components for destructive update simplification.
- Boundary
Component - One connected set of boundary edges from
analyze_mesh. Not in C++ meshoptimizer. - Bounds
- Meaningful fields of
meshopt_Bounds, without native padding. - Bounds
Positions - A borrowed positions view whose bounds-validation scan is cached once.
- Card
Trim Options - Settings for
trim_alpha_cards. Not in C++ meshoptimizer. - Card
Trim Report - Counts and texture-space areas. Not in C++ meshoptimizer.
- Character
Inputs - Borrowed character data; not in C++ meshoptimizer.
- Character
LodChain - Character levels and sampled pose quality; not in C++ meshoptimizer.
- Character
LodSelection - Per-level sampled candidate scores; not in C++ meshoptimizer.
- Character
Options - Metric weights; not in C++ meshoptimizer.
- Character
Skin - Up to eight linear blend skinning influences; not in C++ meshoptimizer.
- Coverage
Statistics - Result of
meshopt_analyzeCoverage. - Fetch
Indices - The source-compatible u32 form of
FetchIndicesGeneric. Borrowed fetch-remap input with its index-validation result cached once. - Fetch
Indices Generic - Borrowed fetch-remap input with its index-validation result cached once.
- Fetched
Mesh - The source-compatible u32 form of
FetchedMeshGeneric. Fetch-ordered initialized vertex bytes and rewritten indices. - Fetched
Mesh Generic - Fetch-ordered initialized vertex bytes and rewritten indices.
- Fill
Holes Report - Hole filling changes and refusals; not in C++ meshoptimizer.
- Filled
Mesh - The source-compatible u32 form of
FilledMeshGeneric. Original indices plus filled faces; not in C++ meshoptimizer. - Filled
Mesh Generic - Original indices plus filled faces; not in C++ meshoptimizer.
- Hidden
Options - Sampling controls. Not in C++ meshoptimizer. Always available, including no_std.
- Hidden
Report - Counts by disjoint removal reason. Not in C++ meshoptimizer.
- Hole
Loop - One boundary component decision; not in C++ meshoptimizer.
- Impostor
Atlas - Baked atlas. Not in C++ meshoptimizer.
- Impostor
Blend - Views and weights from
ImpostorGrid::blend. Not in C++ meshoptimizer. - Impostor
Bounds - Bounding sphere shared by every view. Not in C++ meshoptimizer.
- Impostor
Frame - Orthographic capture frame of one view. Not in C++ meshoptimizer.
- Impostor
Grid - The square grid of view directions. Not in C++ meshoptimizer.
- Impostor
Options - Settings for
bake_impostor. Not in C++ meshoptimizer. - Impostor
Reconstruct - Settings for
ImpostorAtlas::reconstruct_texelandImpostorAtlas::reconstruct_view. Not in C++ meshoptimizer. - Impostor
Report - Counts from
bake_impostor. Not in C++ meshoptimizer. - Impostor
Switch - Impostor switch distance and its error terms. Not in C++ meshoptimizer.
- Limits
- Per-call limits for crate-owned heap storage and counted work.
- Local
Meshlet - The source-compatible u32 form of
LocalMeshletGeneric. Meshlet-local topology with first-visit vertex references. - Local
Meshlet Generic - 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. - LodChain
Attributes - Attribute inputs passed unchanged to the simplifier.
- LodChain
Error - A failed
build_lod_chaincall: the underlyingErrorand the level it occurred in. - LodChain
Generic - The generated levels in target order.
- LodChain
Options - Parameters for the LOD chain builder. Build one with
Self::newand thewith_*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. - LodLevel
Generic - One simplification result. Errors describe this call, not cumulative chain error.
- LodNormal
Deviation - Shading-normal angular deviation in radians.
- LodQuality
- Quality of a level relative to the source; not in C++ meshoptimizer.
- LodQuality
Level - One chain level’s quality and optional camera threshold.
- LodQuality
Mesh - The source-compatible u32 form of
LodQualityMeshGeneric. A borrowed triangle surface. Only referenced vertices are measured/validated. - LodQuality
Mesh Generic - A borrowed triangle surface. Only referenced vertices are measured/validated.
- LodQuality
Options - Deterministic sampling settings (not in C++ meshoptimizer).
- Mesh
Analysis - Topology report from
analyze_mesh. Not in C++ meshoptimizer. - Meshlet
- Current 1.3 descriptor: triangle offsets are consecutive byte offsets, without padding.
- Meshlet
Settings - Limits used by all meshlet builders.
- Meshlet
Sizes - Used prefixes after caller-buffer meshlet construction.
- Meshlets
- The source-compatible u32 form of
MeshletsGeneric. Complete tightly packed meshlet output. - Meshlets
Generic - Complete tightly packed meshlet output.
- Opacity
MapMeasure - Output of upstream
meshopt_opacityMapMeasure. - Orient
Report - Orientation changes and residuals; not in C++ meshoptimizer.
- Oriented
Mesh - The source-compatible u32 form of
OrientedMeshGeneric. Oriented indices with original face order; not in C++ meshoptimizer. - Oriented
Mesh Generic - Oriented indices with original face order; not in C++ meshoptimizer.
- Overdraw
Statistics - Result of
meshopt_analyzeOverdraw. - Partitions
- Cluster-to-partition assignments in upstream order.
- Positions
- Checked borrowed XYZ view, preserving all supplied vertices, including unused ones.
- Positions
Mut - Checked mutable positions for destructive update simplification.
- Process
Clusters - 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.
- Process
Error - Stage failure, not in C++ meshoptimizer. No partial output is returned.
- Process
Level - One optimized level, not in C++ meshoptimizer.
- Process
Options - 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.
- Process
Report - Whole-call report, not in C++ meshoptimizer.
- Process
Skin - Skin fields within each complete vertex record, not in C++ meshoptimizer.
- Process
Stage Report - Machine-readable stage measurement, not in C++ meshoptimizer.
- Processed
Mesh - Atomic pipeline output, not in C++ meshoptimizer.
- Provoking
Mesh - The source-compatible u32 form of
ProvokingMeshGeneric. Unique first-corner indices and source vertices for provoking-vertex rendering. - Provoking
Mesh Generic - Unique first-corner indices and source vertices for provoking-vertex rendering.
- Sanitize
Options - Options for
sanitize. Not in C++ meshoptimizer. - Sanitize
Report - Triangle counts from
sanitizeorsanitize_into. Not in C++ meshoptimizer. - Sanitized
Mesh - The source-compatible u32 form of
SanitizedMeshGeneric. Cleaned triangle list fromsanitize. Not in C++ meshoptimizer. - Sanitized
Mesh Generic - Cleaned triangle list from
sanitize. Not in C++ meshoptimizer. - Simplified
Mesh - The source-compatible u32 form of
SimplifiedMeshGeneric. Simplified topology referencing the original vertex array. - Simplified
Mesh Generic - Simplified topology referencing the original vertex array.
- Simplify
Options - Stable simplification options supported by this port.
- Simplify
Result - Caller-buffer simplification result.
- Simplify
Settings - Parameters for edge-collapse simplification.
- Split
Vertices Report - Fan split counts; not in C++ meshoptimizer.
- Stitch
Report - Stitch decisions; not in C++ meshoptimizer.
- Topology
Repair Generic - Repaired indices and packed attribute records; not in C++ meshoptimizer.
- Trimmed
Cards - The source-compatible u32 form of
TrimmedCardsGeneric. Trimmed vertex and index buffers. Not in C++ meshoptimizer. - Trimmed
Cards Generic - Trimmed vertex and index buffers. Not in C++ meshoptimizer.
- Usage
- Resource measurements for the most recent algorithm call.
- Vertex
Cache Statistics - Result of upstream
meshopt_analyzeVertexCache. - Vertex
Fetch Statistics - Result of upstream
meshopt_analyzeVertexFetch. - Vertex
Field Snapshot - Owned field snapshot exposing existing views, not in C++ meshoptimizer.
- Vertex
Flags - Independent upstream simplification vertex flags; unknown bits are rejected.
- Vertex
Layout - Checked float-array field layout, not in C++ meshoptimizer.
- Vertex
Remap - A compact vertex numbering; unused vertices retain
u32::MAX. - Vertex
Score Table - Caller-defined vertex-cache scores; an opt-in extension not in C++ meshoptimizer.
- Vertex
Stream - Initialized byte records used as binary equality keys. Supplied padding is part of equality; no typed object is reinterpreted as bytes.
- Visible
Mesh - The source-compatible u32 form of
VisibleMeshGeneric. Filtered mesh in original triangle order. Not in C++ meshoptimizer. - Visible
Mesh Generic - Filtered mesh in original triangle order. Not in C++ meshoptimizer.
- Weld
Report - Counts from welding; not in C++ meshoptimizer.
- Welded
Vertices - Old-to-original-representative mapping; not in C++ meshoptimizer.
- Workspace
- Reusable fallibly allocated scratch storage and per-call resource limits.
Enums§
- Alpha
Wrap - Texel lookup outside
0..widthand0..height. Not in C++ meshoptimizer. - Byte
Order - Explicit byte order of floating-point components in byte-backed views.
- Character
LodMethod - Winning method in best-of selection; not in C++ meshoptimizer.
- Error
- Checked input, resource, allocation, or numerical failure.
- Hidden
Views - Views for hidden-surface removal. Not in C++ meshoptimizer. Surfaces occlude from both sides; winding does not affect visibility.
- Impostor
Albedo - Surface colour and alpha source. Not in C++ meshoptimizer.
- Impostor
Layout - 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.
- Process
Stage - A pipeline operation, not in C++ meshoptimizer.
- Retention
- Policy for retaining reusable algorithm scratch between calls.
- Vertex
Layout Error - A construction failure for a typed vertex layout or snapshot.
- Weld
Policy - 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
u16oru32.
Functions§
- analyze_
coverage - The source-compatible u32 entry point; see
analyze_coverage_genericfor 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_genericfor 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_genericfor 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_genericfor 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_genericfor 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_genericfor 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_genericfor 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_genericfor 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_genericfor 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_genericfor 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_genericfor 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_genericfor 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_genericfor 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_genericfor 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_genericfor 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_genericfor 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_genericfor 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_genericfor 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_genericfor 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_expis at least -126 andmax_bitsis 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_genericfor 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_genericfor 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_genericfor 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_edgesis 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_genericfor selectable index widths. - fill_
holes_ into_ generic fill_holesinto caller storage; not in C++ meshoptimizer. Writesreport.output_triangles * 3indices and preserves the tail. A destination offill_holes_boundentries 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_genericfor 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_genericfor 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_genericfor 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_genericfor 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_genericfor 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_genericfor 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_genericfor selectable index widths. - generate_
normals_ generic - Experimental upstream
meshopt_generateNormals, exposed only withexperimental.Noneindices denote an unindexed triangle list. - generate_
normals_ into - The source-compatible u32 entry point; see
generate_normals_into_genericfor 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_genericfor 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_genericfor 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_genericfor 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_genericfor 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_genericfor 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_genericfor 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_genericfor 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_genericfor 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_genericfor selectable index widths. - generate_
tangents_ generic - Generate per-corner XYZ plus handedness, matching
meshopt_generateTangents.Noneindices denote an unindexed triangle list. Normals and UVs are packed. - generate_
tangents_ into - The source-compatible u32 entry point; see
generate_tangents_into_genericfor 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_genericfor 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_genericfor 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_genericfor selectable index widths. - generate_
vertex_ remap_ custom - The source-compatible u32 entry point; see
generate_vertex_remap_custom_genericfor 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_genericfor 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.
Nonevisits 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_genericfor 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_genericfor 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_genericfor 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_genericfor selectable index widths. - measure_
lod_ chain_ quality_ generic - Measure every
build_lod_chainlevel directly againstsourceusing 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_genericfor 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_opacityMapCompactdoes. - 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_genericfor 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_genericfor 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_genericfor 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_genericfor 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_genericfor 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_genericfor 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_genericfor 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_genericfor 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_genericfor 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_genericfor 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_genericfor 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_genericfor selectable index widths. - optimize_
vertex_ cache_ fifo - The source-compatible u32 entry point; see
optimize_vertex_cache_fifo_genericfor 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_genericfor 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_genericfor 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_genericfor 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_genericfor 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_genericfor 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_genericfor 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_genericfor 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_genericfor 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_genericfor 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_genericfor 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; seeoptimize_vertex_fetch_into_genericfor 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_genericfor 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_genericfor 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_genericfor 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_genericfor 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_genericfor 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_genericfor 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_genericfor selectable index widths. - orient_
faces_ into_ generic orient_facesinto 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_genericfor 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_genericfor 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_genericfor 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_genericfor selectable index widths. - remap_
index_ buffer_ into_ generic - Remap arbitrary index sequences.
Noneremaps 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_genericfor selectable index widths. - remesh_
bound - The source-compatible u32 entry point; see
remesh_bound_genericfor 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_genericfor selectable index widths. - remesh_
into_ generic - Write up to
destination.len()/3triangles 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_genericfor 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_genericfor selectable index widths. - remove_
hidden_ triangles_ into_ generic remove_hidden_trianglesinto caller storage. Not in C++ meshoptimizer. At mostindices.len()entries are written. Every error leaves the entire destination unchanged; success writesHiddenReport::index_countentries and preserves the tail. Options, sampling and errors are identical to the owned form, withBufferTooSmallwhen the retained indices do not fit.- sanitize
- The source-compatible u32 entry point; see
sanitize_genericfor selectable index widths. - sanitize_
bound - Upper bound on the indices
sanitize_intowrites: the input index count. Not in C++ meshoptimizer. The exact count isSanitizeReport::index_countof 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_genericfor selectable index widths. - sanitize_
into_ generic sanitizeinto caller storage. Not in C++ meshoptimizer.- simplify
- The source-compatible u32 entry point; see
simplify_genericfor 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_genericfor 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_genericfor 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_genericfor 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_genericfor 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_genericfor 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_genericfor selectable index widths. - simplify_
sloppy_ generic - Grid-based sloppy triangle simplification. Only
LOCKflags 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_genericfor 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_genericfor 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_genericfor selectable index widths. - simplify_
with_ attributes_ into_ generic - Caller-buffer attribute simplification, with the same contracts as
simplify_with_attributesand the mutation guarantee ofsimplify_into. - simplify_
with_ update - The source-compatible u32 entry point; see
simplify_with_update_genericfor 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; seesimplify_with_update_genericfor 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_genericfor 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_genericfor 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_genericfor 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_genericfor 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_genericfor 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_genericfor 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_genericfor 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_meshuses, so afterwardsnon_manifold_verticesis 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.
Noneselects 1e-6 times the largest bounds extent;Someis 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_genericfor 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_indexenables restarts. - stripify_
into - The source-compatible u32 entry point; see
stripify_into_genericfor 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_genericfor 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_genericfor 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_genericfor 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_genericfor selectable index widths. - weld_
vertices_ into_ generic weld_verticesinto caller storage; not in C++ meshoptimizer. On success writespositions.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.