-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
render_primitives
example panics when changing cameras
#15822
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
Labels
Milestone
Comments
rafalh
added a commit
to rafalh/bevy
that referenced
this issue
Oct 16, 2024
Switch to retained render world causes the extracted cameras in render world to not be removed until camera in main world is despawned. When extracting data from main world inactive cameras are skipped. Therefore camera that was active and became inactive has a retained `ExtractedCamera` component from previous frames (when it was active) and is processed the same way as if it were active (there is no `active` field on `ExtractedCamera`). This breakes switching between cameras in `render_primitives` example. Fix it by removing `ExtractedCamera` and related components from inactive cameras. Note that despawning inactive camera seems to be bad option because they are spawned using `SyncToRenderWorld` component. Fixes bevyengine#15822
rafalh
added a commit
to rafalh/bevy
that referenced
this issue
Oct 16, 2024
Switch to retained render world causes the extracted cameras in render world to not be removed until camera in main world is despawned. When extracting data from main world inactive cameras are skipped. Therefore camera that was active and became inactive has a retained `ExtractedCamera` component from previous frames (when it was active) and is processed the same way as if it were active (there is no `active` field on `ExtractedCamera`). This breakes switching between cameras in `render_primitives` example. Fix it by removing `ExtractedCamera` and related components from inactive cameras. Note that despawning inactive camera seems to be bad option because they are spawned using `SyncToRenderWorld` component. Fixes bevyengine#15822
13 tasks
github-merge-queue bot
pushed a commit
that referenced
this issue
Oct 19, 2024
# Objective Switch to retained render world causes the extracted cameras in render world to not be removed until camera in main world is despawned. When extracting data from main world inactive cameras are skipped. Therefore camera that was active and became inactive has a retained `ExtractedCamera` component from previous frames (when it was active) and is processed the same way as if it were active (there is no `active` field on `ExtractedCamera`). This breakes switching between cameras in `render_primitives` example. Fixes #15822 ## Solution Fix it by removing `ExtractedCamera` and related components from inactive cameras. Note that despawning inactive camera seems to be bad option because they are spawned using `SyncToRenderWorld` component. ## Testing Switching camera in `render_primitives` example now works correctly. --------- Co-authored-by: akimakinai <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Bevy version
main, since #15320
Relevant system information
SystemInfo { os: "MacOS 14.5 ", kernel: "23.5.0", cpu: "Apple M1 Max", core_count: "10", memory: "64.0 GiB" }
AdapterInfo { name: "Apple M1 Max", vendor: 0, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "", backend: Metal }
Also tested win+4080
What you did
cargo run --example render_primitives
c
twiceWhat went wrong
Additional information
Related to #15570, broken out here because there are specific repro steps to document.
The text was updated successfully, but these errors were encountered: