aframe
aframe copied to clipboard
Include draco decoder path by default?
I find myself doing this on many scenes:
<a-scene gltf-model="dracoDecoderPath: https://www.gstatic.com/draco/v1/decoders/;">
Would there be any value (or harm) in automatically including the Google CDN Draco decoder path in gltf-model System?
Example change could be:
https://github.com/aframevr/aframe/blob/41547f59f3af57994f29b5da188d3a3d56847622/src/systems/gltf-model.js#L14
14 (old) dracoDecoderPath: {default: ''}
14 (new) dracoDecoderPath: {default: 'https://www.gstatic.com/draco/v1/decoders/'}
Perhaps. @donmccurdy Do you know if there are any downsides from pointing to the google hosted Draco decoded by default?
I would use a versioned URL — here's what <model-viewer> does:
https://github.com/google/model-viewer/blob/9fecc68094b321b0546a19d28f93ff04e1f9d582/packages/model-viewer/src/features/loading.ts#L33-L34
My understanding is that it's meant to be stable and available indefinitely — @FrankGalligan does this sound right?
Yes the versioned URL is now recommended in the release docs:
To use v1.4.1, use this URL: https://www.gstatic.com/draco/versioned/decoders/1.4.1/
So then line 14 could be:
14 (new) dracoDecoderPath: {default: 'https://www.gstatic.com/draco/versioned/decoders/1.5.5/'}
Possible impacts to users:
- If a user specifies another value for path on the scene this will be ignored, so upgrading a project that already specifies
dracoDecoderPathwill not be affected - This library is not loaded unless the draco extension is used in gltf file, so using this default with a scene that doesn't specify
dracoDecoderPathand does not use a gltf model with draco extension will not be affected - For scenes that used gltf models without specifying
dracoDecoderPath, this will now load the new default draco decoder as well as attempt to process the files, so upgrading a project like this would result in change of behavior but this is desired state and the purpose of this pull request.
I'll make a simple PR if that's ok with you @dmarcos
Edited Nov 18 2022:
- updated dracodecoderpath version
Awesome. Yes please a PR would be super appreciated
It would be nice to get this in if someone has some bandwidth
Is this still not done?
@donmccurdy @dmarcos any update on this, please?
What's required would be a PR to update the defaults here...
https://github.com/aframevr/aframe/blob/fbfb4de0827fc7806706c7508cab4df82601a45a/src/systems/gltf-model.js#L25-L30
... along deciding which CDN to use, and testing to make sure the changes work. Agreed with @dmarcos a PR for the change would be welcome.
@donmccurdy My understanding THREE.DRACOLoader lazy loads the decoder. Only fetched when loading a Draco file for the first time. correct?
@dmarcos that's correct!
should we include default for meshoptDecoderPath ?
https://github.com/aframevr/aframe/pull/5156
Appears to be fixed by #5156, thank you!