Closed WestLangley closed 6 years ago
I vote to convert the models to glTF
. We could import them in the editor and then use the Export GLB
option.
BTW: At some point, we might want to consider to move GLTFLoader
into the core. Since it is the recommended 3D format of the project, it's only consequent to provide the corresponding loader in the main build.
Thinking of Draco compression. What's the easiest way to make Draco compressed .glb now?
I'm glad to work on converting or replacing some of these. I'll update the OP with ones I'm working on, in case others want to work in parallel. A few (horse, flamingo, monster) are already available in glTF format I think. The lightmap example would need to use another format though β glTF does not currently support lightmaps, just AO.
Maybe the lightmap model, and perhaps some others, should be updated to the newer JSON format, since having the ability to serialize objects to/from JSON is still valuable to maintain.
What's the easiest way to make Draco compressed .glb now?
The easiest way to add Draco compression to a model already in glTF format is by using glTF-Pipeline, that feature has just been merged to the master branch. Some conversion tools like FBX2GLTF also have Draco compression available as an option. I'd only use it for models where geometry is the dominant size factor, though, to keep things simple.
This leaves me unsure what to do with examples like these:
They exist to show the use of JSONLoader, so changing the format is pointless... How about we remove the second two, keep the first using a single model moved somewhere like examples/models/json/legacy/*
. That would be the only example using JSONLoader and Geometry, once changes above are done, and eventually both Geometry and JSONLoader will be moved out of src/
into examples/js
, I assume?
It's up to @mrdoob, but maybe remove those examples and use the models in webgl_shadowmap.html as the basis for the legacy JSONLoader
example.
i would agree with that, and β
loader / json
to loader / json / legacy
loader / claraio
to loader / json
(it uses THREE.ObjectLoader)loader / json / objconverter
- rename
loader / json
toloader / json / legacy
I would remove this one too, but we do need an example loading a lot of animated characters though.
- rename
loader / json / claraio
toloader / json
(it uses THREE.ObjectLoader)
Sounds good.
eventually both Geometry and JSONLoader will be moved out of
src/
intoexamples/js
, I assume?
Yeah... Somehow... π
I would remove [
loader / json
] too, but we do need an example loading a lot of animated characters though.
So we'll remove all examples of JSONLoader in this process? shadowmap / performance seems pretty good as an example of many animated characters, or would we add another specifically for that?
That is true. shadowmap / performance should do the trick.
Yeah, I think we should remove all JSONLoader
usage. It's okay to still use ObjectLoader
.
I have converted knight.js
to glTF
via GLTFExporter
today. Unfortunately, the resulting knight.glb is over 12 MB (the original JSON file is just 4.1 MB). Any ideas what we should do in this case? Using a different model? AFAIK, knight.js
is currently the only model in the repo that combines skeletal animation with morph target animation. I have tried to Draco-compress the model via glTF pipeline but unfortunately the morph target animation is distorted after this process.
@donmccurdy The code of your PR #15011 was very helpful in order to create the glb
.π
AFAIK, knight.js is currently the only model in the repo that combines skeletal animation with morph target animation
I was testing adding morph targets to the FBX samba model a while ago. I can work on that some more if there is interest.
Unfortunately, the resulting knight.glb is over 12 MB (the original JSON file is just 4.1 MB).
Some of that is related to the BufferGeometry.fromGeometry( geometry )
conversion, which is called automatically by GLTFExporter during export. That adds white vertex colors at least, and may also be spitting the mesh vertices into triangle soup. The source mesh has 16980 vertices but the generated glTF has 98436.
I've been looking for some nice CC-BY examples online that use both skinning and morph targets but haven't found anything I like yet. Having morph targets control facial animations is an illustrative use case, which wouldn't be possible on the Samba model, so I'm not sure about that.
Having morph targets control facial animations is an illustrative use case, which wouldn't be possible on the Samba model, so I'm not sure about that.
Agreed, I was thinking of something much simpler like shrinking / growing the head. However a model that demonstrates facial morphs plus skeletal movement would be ideal.
I've been looking for some nice CC-BY examples online that use both skinning and morph targets but haven't found anything I like yet.
Same here :disappointed:
How about this? https://www.patreon.com/posts/free-animated-22105894
It's 500kb, CC-0, and has 14 skinning animations. I added three morph targets for facial expressions in Blender: demo.
Looks great! π€
Cool! I vote for this model :blush:
JSONLoader
is still used in THREE.UCSCharacter
. The corresponding example is:
https://threejs.org/examples/#webgl_morphtargets_human
I wonder if this example is still necessary since the new skinning/morphing
example allows the manual editing of morph target influence values, too.
Agreed. That example uses legacy Geometry
and can now be removed.
Many thanks to those who helped with this!
Closing.
There are 30+ examples that render legacy
Geometry
becauseJSONLoader
returnsGeometry
.We will need to use a different loader in these examples -- one that returns
BufferGeometry
. That means the following models either need to be converted to another format or replaced with a different model.models/json:
models/animated:
models/skinned:
Suggestions?