threepipe
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

GLTFMeshOptDecodePlugin.md 1.1KB

1 yıl önce
123456789101112131415161718192021222324252627
  1. ---
  2. prev:
  3. text: 'KTXLoadPlugin'
  4. link: './KTXLoadPlugin'
  5. next:
  6. text: 'SimplifyModifierPlugin'
  7. link: './SimplifyModifierPlugin'
  8. ---
  9. # GLTFMeshOptDecodePlugin
  10. [Example](https://threepipe.org/examples/#gltf-meshopt-compression/) —
  11. [Source Code](https://github.com/repalash/threepipe/blob/master/src/plugins/import/GLTFMeshOptDecodePlugin.ts) —
  12. [API Reference](https://threepipe.org/docs/classes/GLTFMeshOptDecodePlugin.html)
  13. Loads the MeshOpt Decoder module from [meshoptimizer](https://github.com/zeux/meshoptimizer) library at runtime from a customisable cdn url.
  14. The loaded module is set in `window.MeshoptDecoder` and then used by `GLTFLoader2` to decode files using [EXT_meshopt_compression](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Vendor/EXT_meshopt_compression/README.md) extension
  15. ```typescript
  16. import {GLTFMeshOptDecodePlugin} from 'threepipe'
  17. const plugin = viewer.addPluginSync(new GLTFMeshOptDecodePlugin())
  18. // await plugin.initialize() // optional, this happens when loading a gltf file with extension anyway
  19. const texture = await viewer.load('file.glb')
  20. ```