Skip to content

Conversation

@pcwalton
Copy link
Contributor

We invoked the extract_default_ui_camera_view system twice: once for 2D cameras and once for 3D cameras. This was fine before moving to resources for render phases, but, after the move to resources, the first thing such systems do is to clear out all the entities-to-be-rendered from the previous frame. So, if the scheduler happened to run extract_default_ui_camera_view::<Camera2d> first, then all the UI elements that it queued would be overwritten by the extract_default_ui_camera_view::<Camera3d> system, or vice versa. The ordering dependence is the reason why this problem was intermittent.

This commit fixes the problem by merging the two systems into one systems, using an Or query filter.

Migration Guide

  • The bevy_ui::render::extract_default_ui_camera_view system is no longer parameterized over the specific type of camera and is hard-wired to either Camera2d or Camera3d components.

We invoked the `extract_default_ui_camera_view` system twice: once for
2D cameras and once for 3D cameras. This was fine before moving to
resources for render phases, but, after the move to resources, the first
thing such systems do is to clear out all the entities-to-be-rendered
from the previous frame. So, if the scheduler happened to run
`extract_default_ui_camera_view::<Camera2d>` first, then all the UI
elements that it queued would be overwritten by the
`extract_default_ui_camera_view::<Camera3d>` system, or vice versa. The
ordering dependence is the reason why this problem was intermittent.

This commit fixes the problem by merging the two systems into one
systems, using an `Or` query filter.
@alice-i-cecile alice-i-cecile added this to the 0.14 milestone May 21, 2024
Copy link
Contributor

@Elabajaba Elabajaba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed it for me.

@mockersf mockersf added C-Bug An unexpected or incorrect behavior A-Rendering Drawing game state to the screen A-UI Graphical user interfaces, styles, layouts, and widgets S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it labels May 21, 2024
@mockersf mockersf added this pull request to the merge queue May 21, 2024
Copy link
Contributor

@IceSentry IceSentry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it's technically possible for users to have been using that with the generic parameter but I doubt it's all that common.

Merged via the queue into bevyengine:main with commit a785e3c May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Rendering Drawing game state to the screen A-UI Graphical user interfaces, styles, layouts, and widgets C-Bug An unexpected or incorrect behavior S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants