aframevr / aframe

:a: Web framework for building virtual reality experiences.
https://aframe.io/
MIT License
16.69k stars 3.98k forks source link

Consider putting gltf-model into core? #2261

Closed donmccurdy closed 7 years ago

donmccurdy commented 7 years ago

Discussing how best to maintain gltf-model with @xirvr; perhaps either (1) merge it into aframe-extras.loaders, or (2) merge it into core.

Advantages of having gltf-model in core:

Disadvantages:

Further discussion of animation: https://github.com/xirvr/aframe-gltf/issues/9


Proposed syntax for any THREE.AnimationMixer-compatible format, including glTF, with animation:

<a-entity foo-model="src: homestar.foo"
          animation-mixer="clip: run"></a-entity>
ngokevin commented 7 years ago

Yeah, I'd agree with adding gltf-model to core. If we need to pull in a way of animating models, we can do that too.

christimahu commented 7 years ago

Nice. I have pretty limited time this next few months, but do think this is super important for 3D web for all the reasons Don mentioned and we all already know :)

@ngokevin how do you suggest we do this? There's very little in the component itself that's glTF specific, most of what's in the component I made is build tools and demo -- I would assume it's as easy as copy pasting the Collada component and changing a few lines to make glTF part of core?

dmarcos commented 7 years ago

How is the adoption of gltf so far? What's the status of exporters from popular tools: Blender, Cinema 4D, 3D Studio, Maya... What's the status of the three.js loader? I know that when we tried to use it for our demos everything looked pretty immature @feiss What do you think?

ngokevin commented 7 years ago

The common argument is that we help drive the adoption.

donmccurdy commented 7 years ago

I'm fairly confident about THREE.GLTFLoader. It was fully re-written over the last 6 months, the code is relatively clean, and both @takahirox and I have been contributing to its maintenance. It's close to supporting all of the official glTF sample models — perhaps by THREE.js r84 or r85.

There are some converters, I'm not sure how well they work. There's not much available for exporters. My vote would be for us (A-Frame, and THREE.js) to go out on a limb a bit to support rendering the format, in the hope that we drive adoption and encourage tooling to catch up.

christimahu commented 7 years ago

The command line Collada to glTF converter works quite well, but it's fairly tricky to set up. There is an online converter that works for testing, but doesn't build to multiple files so binary data (even when not in binary mode) is baked in, making it giant / slow to parse.

Autodesk has an FBX to glTF converter, to my understanding coming out quite soon, which I expect to be pretty strong. Autodesk also has a new project that is WebGL focused, which I'd be surprised if it didn't integrate glTF soon (Project Play).

Blender has an exporter plugin, but haven't used it -- I've only heard one person trying to use it, and I think they had problems with it.

All things considered, I think the Collada to glTF converter is worth the headache of getting it running (just like most front-end developers are now used to the permission problems Node initially has when they are not used to a Linux system).

... but confess that I'm biased ;)

christimahu commented 7 years ago

Also, figured I'd point out that with Unity, you can make things like this:

https://vimeo.com/181420338 https://vimeo.com/192071365 https://www.youtube.com/watch?v=tVHH3-bP-fE

It might be that a run-time focused library (i.e. ThreeJS + AFrame, Babylon, regl) won't catch up to what a compile time library (Unity, Unreal; leveraging Emscripten and soon Web Assembly) -- but if (Three/AFrame) it is to have a chance, the kind of shader, geometry, and animation work in the above three examples needs to be done by a designer and exported in a way the run-time libraries can use them -- trust me, trying to code these is insanity :)

One more side note on adoption, Babylon has support for glTF, and I believe someone is working on an importer for regl as well.

donmccurdy commented 7 years ago

@ngokevin @dmarcos thoughts y/n? glad to put together a PR if we want to see how much is involved, should be comparable to other formats though.

dmarcos commented 7 years ago

Yes, please go ahead.