Skip to content

Conversation

@DeVelox
Copy link
Contributor

@DeVelox DeVelox commented Nov 5, 2025

Objective

  • Test the impact that many overlapping cubes, all within the camera frustum, have on visibility/occlusion calculations, especially with continuous rotation and shadows enabled.

Solution

  • Add a dense cube layout using a static camera, and a toggle for individual cube rotation.

Testing

  • I ran the test in several stages, each causing a considerable performance drop.
    • Stage 1: using just the dense layout.
    • Stage 2: using the dense layout with rotation or shadows enabled.
    • Stage 3: using the dense layout with both rotation and shadows enabled.
cargo run --release --example many_cubes -- --layout dense --rotate-cubes --shadows

Showcase

image

@github-actions
Copy link
Contributor

github-actions bot commented Nov 5, 2025

Welcome, new contributor!

Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨

@laundmo
Copy link
Contributor

laundmo commented Nov 5, 2025

We talked about this on discord, there seems to be some inefficiency with the visibility calculations, according to traces shared by @DeVelox in https://github.com/DeVelox/many_cubes

@alice-i-cecile alice-i-cecile added A-Rendering Drawing game state to the screen C-Examples An addition or correction to our examples S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it C-Testing A change that impacts how we test Bevy or how users test their apps labels Nov 5, 2025
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Nov 5, 2025
Merged via the queue into bevyengine:main with commit ea953aa Nov 5, 2025
@github-project-automation github-project-automation bot moved this to Done in Rendering Nov 5, 2025
github-merge-queue bot pushed a commit that referenced this pull request Nov 5, 2025
…pact on performance (#21755)

Quick follow-up to #21745.

Co-authored-by: Alice Cecile <[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-Examples An addition or correction to our examples C-Testing A change that impacts how we test Bevy or how users test their apps S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants