Skip to content

Add GLTF support.#79

Open
tychedelia wants to merge 3 commits intoprocessing:mainfrom
tychedelia:gltf
Open

Add GLTF support.#79
tychedelia wants to merge 3 commits intoprocessing:mainfrom
tychedelia:gltf

Conversation

@tychedelia
Copy link
Member

Adds GLTF support via Bevy's scene loading mechanisms

This is a little sketchy but mostly works. Right now, we support creating a GLTF scene via load_gltf. This API object is just a container for the underlying Bevy scene and by default doesn't have any impact on the sketch.

The user can then "request" meshes or materials via GLTF node name, in which case we will clone out the relevant data and return the respective Geometry or Material API object. There's some careful work that needs to be done here to ensure that we keep the correct transform data for the mesh in the event it was parented in the GLTF hierarchy.

Users can also retrieve lights by index (lights have no name in GLTF). They can also call gltf.camera to update the Graphics transform to match the GLTF camera found at that index. This leaves a little bit to be desired from an API perspective and should be iterated on.

I'll leave an explanation of Bevy's scene mechanics to your exploration. Note, some of these mechanics are likely changing soon with BSN.

Long term, I think we want to consider what APIs look like for this kind of scene data with deep transform hierarchies. For example, right now we require explicitly pulling each item out of the scene you want to render, but perhaps it would make sense to render an entire scene as "static" data and then only have the user pull out the items they want to animate. But other questions remain like, how do we let the user parent new items to this hierarchy? Etc.

@tychedelia tychedelia requested a review from catilac February 25, 2026 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant