vpenades / SharpGLTF

glTF reader and writer for .NET Standard
MIT License
454 stars 72 forks source link

Nested Scene #153

Closed raffdp closed 1 month ago

raffdp commented 1 year ago

This is probably as much a core glTF question as it is SharpGLTF, but can a scene be created containing nodes which in themselves are scenes, and in turn each scene is saved out to a series of separate glTF/glb files? For example, you might have some common scene elements that can be reused in another scene and instead of duplicating the data you share/reuse the data as an external scene reference which gets loaded/merged into the root scene at load time.

vpenades commented 1 year ago

what you're asking for is called "external references" ... I think it's been discussed in the glTF board, and it's usually rejected.

Technically it could be possible to do it with a custom extension... but if the "master glTF" only has references to other glTFs, it could be better to define your own "master scene" format.

Also keep in mind that glTF is designed so resources can be coalesced , for example, you can have a glTF with many meshes, used by several scenes... but all meshes using a single big vertex buffer, which helps the graphics cards render faster. That would not be possible if you split the glTF into multiple ones. In other words, having "multiple reusable" glTF components might make sense from the point of view of design, but not from the point of view of a graphics card, which preffer big blobs.