Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement and register Reflect (value) for CameraRenderGraph and CameraMainTextureUsages #11878

Merged
merged 1 commit into from
Feb 16, 2024

Conversation

cart
Copy link
Member

@cart cart commented Feb 15, 2024

Objective

The new render graph labels do not (and cannot) implement normal Reflect, which breaks spawning scenes with cameras (including GLTF scenes). Likewise, the new CameraMainTextureUsages also does not (and cannot) implement normal Reflect because it uses wgpu::TextureUsages under the hood.

Fixes #11852

Solution

This implements minimal "reflect value" for CameraRenderGraph and CameraMainTextureUsages and registers the types, which satisfies our spawn logic.

Note that this does not fix scene serialization for these types, which will require more significant changes. We will especially need to think about how (and if) "interned labels" will fit into the scene system. For the purposes of 0.13, I think this is the best we can do. Given that this serialization issue is prevalent throughout Bevy atm, I'm ok with adding a couple more to the pile. When we roll out the new scene system, we will be forced to solve these on a case-by-case basis.


Changelog

  • Implement Reflect (value) for CameraMainTextureUsages and CameraRenderGraph, and register those types.

@alice-i-cecile alice-i-cecile added this to the 0.13 milestone Feb 15, 2024
@cart cart added A-Scenes Serialized ECS data stored on the disk A-Reflection Runtime information about types C-Bug An unexpected or incorrect behavior labels Feb 15, 2024
@alice-i-cecile
Copy link
Member

Note that this does not fix scene serialization for these types, which will require more significant changes

So to be clear, this allows cameras to be spawned, but the exact values of these components are not properly preserved?

@cart
Copy link
Member Author

cart commented Feb 15, 2024

So to be clear, this allows cameras to be spawned, but the exact values of these components are not properly preserved?

The GLTF loader constructs a Scene at runtime, which uses FromReflect to construct copies on spawn, which preserves the value because these components are "reflect values" / clone-able

@cart cart added this pull request to the merge queue Feb 15, 2024
Merged via the queue into bevyengine:main with commit fe777d5 Feb 16, 2024
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Reflection Runtime information about types A-Scenes Serialized ECS data stored on the disk C-Bug An unexpected or incorrect behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Spawning scenes with cameras no longer works
2 participants