Applies Meshopt compression using EXT_meshopt_compression.
This type of compression can reduce the size of point, line, and triangle geometry,
morph targets, and animation data.
This function is a thin wrapper around reorder, quantize, and
EXTMeshoptCompression, and exposes relatively few configuration options.
To access more options (like quantization bits) direct use of the underlying
functions is recommended.
Applies Meshopt compression using EXT_meshopt_compression. This type of compression can reduce the size of point, line, and triangle geometry, morph targets, and animation data.
This function is a thin wrapper around reorder, quantize, and EXTMeshoptCompression, and exposes relatively few configuration options. To access more options (like quantization bits) direct use of the underlying functions is recommended.
Example:
import { MeshoptEncoder } from 'meshoptimizer'; import { meshopt } from '@gltf-transform/functions'; await MeshoptEncoder.ready; await document.transform( meshopt({encoder: MeshoptEncoder, level: 'medium'}) );