MeshoptDecoder

interface MeshoptDecoder

Pluggable codec for the EXT_meshopt_compression glTF extension.

Meshopt (Arseny Kapoulkine's meshoptimizer) is a fast-decode mesh compression scheme that compresses bufferViews directly — by contrast Draco operates on whole primitives, and KTX2 on textures. The decoder gets the compressed bufferView bytes plus the per- element layout (count + byteStride + mode + optional filter) and returns the decompressed bufferView in the same byte layout the glTF accessors expect.

The engine has no built-in implementation; the codec ships as worldwind-formats-gltf-meshopt.

Implementations must be thread-safe and stateless. Decode runs on every mesh tile fetch that ships meshopt-compressed primitives (Google Photorealistic 3D Tiles' Draco alternative; Cesium Ion supports it for some assets).

Types

Link copied to clipboard

Per-element transform applied after the base decode. Maps to meshoptimizer's meshopt_decodeFilter* family.

Link copied to clipboard

What the compressed bufferView encodes.

Functions

Link copied to clipboard
abstract fun decode(compressed: ByteArray, count: Int, byteStride: Int, mode: MeshoptDecoder.Mode, filter: MeshoptDecoder.Filter? = null): ByteArray

Decode an EXT_meshopt_compression bufferView.