Skip to content

Merge car meshes in bevy_city and improve loading screen#23574

Open
IceSentry wants to merge 3 commits intobevyengine:mainfrom
IceSentry:bevy_city_merge_car_tires
Open

Merge car meshes in bevy_city and improve loading screen#23574
IceSentry wants to merge 3 commits intobevyengine:mainfrom
IceSentry:bevy_city_merge_car_tires

Conversation

@IceSentry
Copy link
Copy Markdown
Contributor

@IceSentry IceSentry commented Mar 29, 2026

Objective

  • In the asset pack used for bevy_city the tires of all the cars are separate meshes from the car body. In some of the cars even the doors are also separate meshes.
  • Since we don't animate these elements of the car we can trivially combine all the meshes of each car scene into one single car mesh. This helps a lot to keep performance manageable and eventually increase the scale of bevy_city.

Solution

  • Wait for the assets to load and once they are loaded loop over all the car scenes and combine their meshes. This is mainly possible because the entire asset pack uses a single texture so we don't need a separate material for each part of the mesh.
  • To do this I also refactored a bit how each step happens when starting the app. I also made sure that each step is reflected on the loading screen.
  • I also added a bit more docs

Testing

  • I ran bevy_city and confirmed that the tires are where they should be relative to the mesh and that performance was better. I went from 90fps to 112fps on my machine

Showcase

bevy_city_process_assets.mp4

@IceSentry IceSentry added C-Examples An addition or correction to our examples D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Mar 29, 2026
@IceSentry IceSentry added A-Rendering Drawing game state to the screen C-Performance A change motivated by improving speed, memory usage or compile times C-Benchmarks Stress tests and benchmarks used to measure how fast things are X-Uncontroversial This work is generally agreed upon labels Mar 29, 2026
@github-project-automation github-project-automation bot moved this to Needs SME Triage in Rendering Mar 29, 2026
@alice-i-cecile alice-i-cecile added the A-Assets Load files from disk to use for things like images, models, and sounds label Mar 30, 2026
@github-project-automation github-project-automation bot moved this to Needs SME Triage in Assets Mar 30, 2026
Copy link
Copy Markdown
Contributor

@ChristopherBiscardi ChristopherBiscardi left a comment

Choose a reason for hiding this comment

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

changes seem good to me.

The ui is... really, really small to the point of being unusable in this demo. Did I miss a setting or control?

Image

///
/// The asset pack we are using uses a separate mesh for each tire of the car and some also have
/// doors as separate meshes. For our purposes we don't need them to be separate meshes and this
/// was causing a lot of performance issues.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should mention what performance issues specifically this was meant to optimize, otherwise this will become cargo-culted forward without context in the future.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oh, yeah, I didn't really think about that kind of impact. I'll try to rephrase that.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I updated the comment, please let me know what you think. I think I gave enough details as to why this is done.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

it's great, thanks!

@alice-i-cecile alice-i-cecile added S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Mar 30, 2026
@alice-i-cecile alice-i-cecile added this to the 0.19 milestone Mar 30, 2026
@IceSentry IceSentry added S-Needs-Review Needs reviewer attention (from anyone!) to move forward and removed S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged labels Mar 31, 2026
@andriyDev andriyDev added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Assets Load files from disk to use for things like images, models, and sounds A-Rendering Drawing game state to the screen C-Benchmarks Stress tests and benchmarks used to measure how fast things are C-Examples An addition or correction to our examples C-Performance A change motivated by improving speed, memory usage or compile times D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it X-Uncontroversial This work is generally agreed upon

Projects

Status: Needs SME Triage
Status: Needs SME Triage

Development

Successfully merging this pull request may close these issues.

4 participants