meshoptPath
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.
Model | Before Compression | After Compression (Used gltfpack's -tc -cc flag) |
---|---|---|
Vintage Pocket Watch | 5.95MB | 1.37MB (-76.97%) |
caution
Note that SceneViewer AR session can't handle models with EXT_meshopt_compression
enabled.
Example
- JSON
- JavaScript
- React
- Angular
- Vue@2
- Vue@3
- Svelte
{
src: "/egjs-view3d/model/meshopt/watch.glb",
meshoptPath: "/egjs-view3d/lib/meshopt_decoder.js"
}