aframe icon indicating copy to clipboard operation
aframe copied to clipboard

Include draco decoder path by default?

Open kfarr opened this issue 4 years ago • 5 comments

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/'}

kfarr avatar Nov 20 '20 06:11 kfarr

Perhaps. @donmccurdy Do you know if there are any downsides from pointing to the google hosted Draco decoded by default?

dmarcos avatar Nov 20 '20 19:11 dmarcos

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?

donmccurdy avatar Nov 20 '20 19:11 donmccurdy

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 dracoDecoderPath will 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 dracoDecoderPath and 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

kfarr avatar Aug 18 '21 02:08 kfarr

Awesome. Yes please a PR would be super appreciated

dmarcos avatar Aug 22 '21 01:08 dmarcos

It would be nice to get this in if someone has some bandwidth

dmarcos avatar Mar 15 '22 17:03 dmarcos

Is this still not done?

kylebakerio avatar Oct 15 '22 21:10 kylebakerio

@donmccurdy @dmarcos any update on this, please?

devhims avatar Oct 18 '22 22:10 devhims

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 avatar Nov 04 '22 19:11 donmccurdy

@donmccurdy My understanding THREE.DRACOLoader lazy loads the decoder. Only fetched when loading a Draco file for the first time. correct?

dmarcos avatar Nov 17 '22 18:11 dmarcos

@dmarcos that's correct!

donmccurdy avatar Nov 17 '22 18:11 donmccurdy

should we include default for meshoptDecoderPath ?

kfarr avatar Nov 19 '22 05:11 kfarr

https://github.com/aframevr/aframe/pull/5156

kfarr avatar Nov 19 '22 05:11 kfarr

Appears to be fixed by #5156, thank you!

donmccurdy avatar Dec 04 '22 18:12 donmccurdy