rendajs / Renda

A modern rendering engine for the web.
https://rendajs.org
MIT License
10 stars 4 forks source link

More control over how glTF files with multiple scenes are loaded #820

Open jespertheend opened 10 months ago

jespertheend commented 10 months ago

The gltf spec has some things to say about how scenes work: https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#scenes

Right now the gltf loader just throws all scenes into a single entity, which isn't great, because most of the time you only need a single scene. In fact, often gltf only has a single scene, ideally it wouldn't create any extra 'root' entities in that case. I think parseGltf should probably contain an option that allows you to pick a specific scene, but it should also still be possible to load all scenes, otherwise you lose the benefit of sharing materials etc. between scenes.

The spec also says

A glTF asset that does not contain any scenes SHOULD be treated as a library of individual entities such as materials or meshes.

Not sure how to deal with that though...