GLTFLoader: Extensibility
See original GitHub issueHi,
We are currently implement b3dm (a format that encapsulates glTF) support in our project and have encountered a few problems with the current GLTFLoader implementation.
We need to support addition attribute (batchid
, used to identify the different objects packed in the geometry), extensions (CESIUM_RTC) and potentially additional uniforms. However, there does not seem to be any way to add these new features without modifying the GLTFLoader file itself.
So my question is: how to support the extensible nature of glTF? Do we contribute directly to the source and add the attributes/extensions/uniforms that we need? Or does the loader need to be modified so extensions can be “plugged in” without changing the source?
Related question: when loading glTFs in a scene rendered using a logarithmic depth buffer, the model’s shader are not modified to account for it, resulting in depth issues: http://jsfiddle.net/x6ufnz3y/. I implemented a small hack to fix the problem. Should this process be added to the loader natively? Or could Three provide a helper function to patch the materials?
Issue Analytics
- State:
- Created 6 years ago
- Comments:27 (3 by maintainers)
On a similar topic, I may need to postprocess some geometry before exporting to glTF. Would there be any interest if I proposed a similar extension mechanism for GLTFExporter? For instance I need to not export certain subtrees, and change materials to glTF-compatible ones. (If there is any interest I’ll follow up in a new issue of course. Don’t want to hijack this discussion.)
Should be solved via #19144 (which was merged in
r118
).