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

Entities that should be visible are being culled #17759

Closed
superdump opened this issue Feb 9, 2025 · 1 comment · Fixed by #17787
Closed

Entities that should be visible are being culled #17759

superdump opened this issue Feb 9, 2025 · 1 comment · Fixed by #17787
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled

Comments

@superdump
Copy link
Contributor

Bevy version

main @ 556b75078288464e9628d3e939afdedfea34e958

[Optional] Relevant system information

2025-02-09T14:21:00.168791Z  INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "macOS 15.3 Sequoia", kernel: "24.3.0", cpu: "Apple M4 Max", core_count: "16", memory: "64.0 GiB" }    
2025-02-09T14:21:00.234400Z  INFO bevy_render::renderer: AdapterInfo { name: "Apple M4 Max", vendor: 0, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "", backend: Metal }

What you did

Run cargo run --release --example many_cubes

What went wrong

Expected: all cubes that should be visible are visible in every frame

Observed: some cubes are not visible when they should be.

Additional information

As they are only missing for a few frames it is difficult to take a screenshot but here is a short screen capture where the missing cubes can be seen as they come into view from the top of the frame.

2025-02-09.at.15.44.49.-.Broken.culling.H264.mp4
@superdump superdump added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Feb 9, 2025
@rparrett
Copy link
Contributor

This is even more apparent for me in debug mode.

Image

It seems to bisect to 7fc122a

@rparrett rparrett added the A-Rendering Drawing game state to the screen label Feb 10, 2025
pcwalton added a commit to pcwalton/bevy that referenced this issue Feb 10, 2025
Currently, we *sweep*, or remove entities from bins when those entities
became invisible or changed phases, during `queue_material_meshes` and
similar phases. This, however, is wrong, because `queue_material_meshes`
executes once per material type, not once per phase. This could result
in sweeping bins multiple times per phase, which can corrupt the bins.
This commit fixes the issue by moving sweeping to a separate system that
runs after queuing.

This manifested itself as entities appearing and disappearing seemingly
at random.

Closes bevyengine#17759.
github-merge-queue bot pushed a commit that referenced this issue Feb 10, 2025
Currently, we *sweep*, or remove entities from bins when those entities
became invisible or changed phases, during `queue_material_meshes` and
similar phases. This, however, is wrong, because `queue_material_meshes`
executes once per material type, not once per phase. This could result
in sweeping bins multiple times per phase, which can corrupt the bins.
This commit fixes the issue by moving sweeping to a separate system that
runs after queuing.

This manifested itself as entities appearing and disappearing seemingly
at random.

Closes #17759.

---------

Co-authored-by: Robert Swain <[email protected]>
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 C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants