Jump to content

Using glTF extensions question


freetoplay
 Share

Recommended Posts

I want to load a file with the draco compression extension, I am doing something like this:

BABYLON.SceneLoader.Append("https://rawgit.com/KhronosGroup/glTF-Sample-Models/master/2.0/Duck/glTF-Draco/", "Duck.gltf", scene, function (scene) {
// do something
}

This works fine, but how do I know if the draco compression extension has been applied? The reason I am asking is the documentation for "append" accepts a parameter called pluginExtension, so I am not sure if I need to explicitly pass in the extension or it's done automatically.

Link to comment
Share on other sites

The draco compression extension is used automatically, if you have a v2 model. The loader v1 or v2 is chosen based on the file version:
https://doc.babylonjs.com/how_to/gltf#full-version

You can read more about the decoder here:
https://doc.babylonjs.com/api/classes/babylon.dracocompression

Use BABYLON.DracoCompression.DecoderAvailable to determine if the decoder is available for the current session.

 

16 minutes ago, freetoplay said:

The reason I am asking is the documentation for "append" accepts a parameter called pluginExtension

I think that's only if you want to override, because an appropriate loader will be used based on the file extension. ie: you can force a gltf loader on a file missing an extension:

https://github.com/BabylonJS/Babylon.js/blob/master/src/Loading/babylon.sceneLoader.ts#L251

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...