microsoft/glTF-Toolkit

Pipeline features

donmccurdy opened this issue ยท 8 comments

Hi! Awesome toolkit you've started here, thanks for doing this. ๐Ÿ™‚ Wanted to share some ideas on things that could make this more useful to WebVR devs, and so, (apologies in advance for all the feature requests!) here are some thoughts. In no particular order:

  • Enable building source on Unix systems, or provide binaries. This would allow others to host this as a web UI tool for convenience, see discussion here.
  • Option to merge meshes with shared materials. I see this issue all the time on models from various sources, and many WebVR devs don't realize it's an issue. I use obj-simplify to solve this in OBJ files, and a similar tool for glTF could be helpful.
  • Option to strip specific attributes. For example many models include tangents by default, but environments like three.js and A-Frame currently ignore them, so it's just added weight.
  • Option to merge multiple animated glTF assets into a single asset with multiple animations. If authoring tools begin to support multiple animations they may not be necessary, but currently virtually none do, and it's unclear to me how/if to handle that in Autodesk workflows.

Best,
Don

Thanks for the comments @donmccurdy ! Glad to be of help. About your specific comments:

  • Unix systems: I'm all for it, just don't have the bandwidth or the expertise. PRs welcome!
  • Merge meshes with shared materials: Sounds interesting, don't know exactly what that would entail.
  • Strip attributes: @mhurliman is adding some optimizations from DirectXMesh; I don't think they strip anything but in the same vein should be pretty simple to implement. Do you have specifics?
  • Merge animated assets: How would we guarantee that the "static" part of the asset is the same? The implementation is again simple but the requirements may vary a lot.

Once again thanks and of course you're more than welcome to contribute to the toolkit.
Thanks!
Roberto

Unix systems

+1 for Linux support as bandwidth allows. The Cesium team would certainty use glTF-Toolkit in our geospatial content pipeline if we could run it on our Linux-based servers.

This would also open up glTF-Toolkit to a larger contributor community.

Merge animated assets

See issue on FBX2glTF; i think the expectation would be that the skeleton has identical structure and matching node names. But perhaps this issue makes more sense on FBX2glTF... hopefully direct-to-glTF tooling will begin supporting multiple animations soon.

Merge meshes with shared materials

I think the idea is to reduce draw calls by batching the geometry directly. So if a gltf has 30 meshes with a blue material and 30 with red, ideally glTF-Toolkit would be able to detect that many meshes are sharing a material and combine them into one large mesh. So 60 draw calls gets reduced to 2.

Cesium can do this with internal geometry types, and gltf-pipeline can also do this to some extent.

Merge meshes with shared materials

So if I'm right there're some situations where it'd better not to merge, for example

  • skinned mesh
  • mesh with transparent material
  • user wanna control meshes' transforms separately

correct? And any other situations?

IMO merging meshes would need to be an opt-in flag; even with skinned meshes or transparent materials, the user might or might not want that optimization.

The glTF toolkit is a set of methods on a library, not an executable pipeline. We do have one executable pipeline for Windows Mixed Reality, but the idea for other use cases would be that you would pick and choose what optimizations you want and make your own executable by calling the appropriate library methods.

Thanks for sharing your thoughts. I wanted to share that the merging meshes technique isn't a perfect solution and has some limitations to help you know the technique well.