Skip to main content

meshoptPath

Typestring | null
Defaultnull

URL to Meshoptimizer decoder js path.

It adds an ability to decode 3D models with EXT_meshopt_compression enabled.
Decoder will be loaded on View3D's initialization, so you should set decoder path before initialization.
It's null by default, which means it won't handle such models.
Quick fix is to use the CDN below.

https://unpkg.com/meshoptimizer@0.17.0/meshopt_decoder.js

Similar to Draco, meshopt can compress the geometry data of the 3D model.
The table below compares the before and after compression of the example model below.

ModelBefore CompressionAfter Compression (Used gltfpack's -tc -cc flag)
Vintage Pocket Watch5.95MB1.37MB (-76.97%)
caution

Note that SceneViewer AR session can't handle models with EXT_meshopt_compression enabled.

Example

{
src: "/egjs-view3d/model/meshopt/watch.glb",
meshoptPath: "/egjs-view3d/lib/meshopt_decoder.js"
}