Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add EXT_meshopt_compression support #237

Closed
donmccurdy opened this issue Jan 20, 2021 · 2 comments
Closed

Add EXT_meshopt_compression support #237

donmccurdy opened this issue Jan 20, 2021 · 2 comments
Assignees

Comments

@donmccurdy
Copy link
Owner

See mrdoob/three.js#21114.

@zeux
Copy link
Contributor

zeux commented Jan 26, 2021

Out of curiosity, would something like this zeux/meshoptimizer#232 be of interest here, or is copying the decoder .js a natural/expected route to follow for three.js?

@donmccurdy
Copy link
Owner Author

Thanks for checking — I don't think it makes much difference for this viewer, since three.js is already a dependency and I have the option of copying the decoder into this repository's Git tree or importing from the three.js npm package. I just haven't gotten to it yet.

A separate npm package for the meshoptimizer decoder could be helpful for donmccurdy/glTF-Transform#106, though, since it doesn't already depend on three.js. That would allow glTF-Transform to decompress a glTF file using KHR_meshopt_compression to a vanilla glTF file. The workflow for reading files using Draco, for example, is...

import { NodeIO } from '@gltf-transform/core';
import { DracoMeshCompression } from '@gltf-transform/extensions';

import * as draco3d from 'draco3dgltf';

const io = new NodeIO()
  .registerExtensions([DracoMeshCompression])
  .registerDependencies({
    'draco3d.decoder': await draco3d.createDecoderModule(), // Optional.
    'draco3d.encoder': await draco3d.createEncoderModule(), // Optional.
  });

const doc = io.read('compressed.glb');

... which allows me to leave those dependencies out of the library itself, while still making it easy for users to enable them.

@donmccurdy donmccurdy self-assigned this Feb 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants