Three.js: GLTFLoader: A question about backward compatibility

Created on 9 Oct 2017  Â·  6Comments  Â·  Source: mrdoob/three.js

Description of the problem

see https://discourse.threejs.org/t/does-three-have-a-gltf-1-0-loader/953

tl;dr: What is the recommendation for users if they want to load a glTF 1.0 model with three.js.

Is it necessary to re-export the model to glTF 2.0? Is there something like a glTF converter? Are there any best practices or guides within the glTF community for this use case?

/ping @donmccurdy, @cx20
/cc @pailhead, @looeee

Question

Most helpful comment

We could suggest using GLTFLoader from r86 in this case, but:

Of the glTF1.0 exporters in the list, the first three are all based on COLLADA2GLTF (which does urgently need to be updated, and that's in progress on a 2.0 branch). Of the remaining two, FBX-glTF was never actually stable on glTF1.0 (I would avoid it entirely), and jgltf-obj I have not tried but there are other OBJ converters.

So, there are fewer glTF1 tools than it appears, and already vastly more glTF2 models available online than glTF1 models. So I would suggest we heavily recommend glTF2 when possible.

There is a glTF1->glTF2 converter built into glTF-pipeline's 2.0 branch. I've filed an issue asking about the status of that.

All 6 comments

We could suggest using GLTFLoader from r86 in this case, but:

Of the glTF1.0 exporters in the list, the first three are all based on COLLADA2GLTF (which does urgently need to be updated, and that's in progress on a 2.0 branch). Of the remaining two, FBX-glTF was never actually stable on glTF1.0 (I would avoid it entirely), and jgltf-obj I have not tried but there are other OBJ converters.

So, there are fewer glTF1 tools than it appears, and already vastly more glTF2 models available online than glTF1 models. So I would suggest we heavily recommend glTF2 when possible.

There is a glTF1->glTF2 converter built into glTF-pipeline's 2.0 branch. I've filed an issue asking about the status of that.

Oh, one other note I would add — glTF is a _delivery_ format, unlike FBX and COLLADA. It will discard data you might want if you plan to edit later, like a JPG discards PSD layers. As a result, it is definitely best practice to keep your source FBX/COLLADA/Blender files around even after you have a working glTF.

Maybe until the glTF1->glTF2 and/or the COLLADA2GLTF are dialed in, include the GLTF1 loader in addition to the GLTF loader?

I had some trouble finding this, i first went in and modified the modules that tparisi published so i could even include them in my env. Only later did i find the consolidated GLTF(1) loader.

Maybe until the glTF1->glTF2 and/or the COLLADA2GLTF are dialed in, include the GLTF1 loader in addition to the GLTF loader?

Have you tried exporting to glTF2 yet? I would like to think tooling is robust enough that there's no good reason to prefer glTF1 anymore. I'd much rather invest time in improving glTF2 support — there's more to do than I have time for already — than maintaining the glTF1 version and dealing with problems developers may run into while using it. A comment on the GLTFLoader docs, to the effect of "Here's where you can find the glTF1 version, but prefer glTF2, caveat emptor" would be fine.

All of the glTF2 sample models were generated with the 2.0 branch of COLLADA2GLTF, so it should be quite useable. Upconverting from glTF1->glTF2 is farther away, but again there are relatively few glTF1 files floating around.

Have you tried exporting to glTF2 yet? I would like to think tooling is robust enough that there's no good reason to prefer glTF1 anymore.

Actually I haven't, I didn't understand it was useable, I just looked at the page and thought it only supported v1. It seems that people usually have .dae as "source" laying around.

We could suggest using GLTFLoader from r86 in this case

I guess we can now point them to LegacyGLTFLoader:
https://github.com/mrdoob/three.js/blob/dev/examples/js/loaders/deprecated/LegacyGLTFLoader.js

Was this page helpful?
0 / 5 - 0 ratings

Related issues

qornflex picture qornflex  Â·  113Comments

lmcd picture lmcd  Â·  74Comments

kumavis picture kumavis  Â·  153Comments

fernandojsg picture fernandojsg  Â·  85Comments

DefinitelyMaybe picture DefinitelyMaybe  Â·  88Comments