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

Add many_materials stress test #17346

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

CrazyRoka
Copy link
Contributor

@CrazyRoka CrazyRoka commented Jan 13, 2025

Objective

Solution

  • Created a new example (examples/stress_tests/many_materials.rs) that renders a grid of cubes with animated materials.
  • The size of the grid can be configured using the -n command-line argument (or --grid-size). The default grid size is 10x10.
  • The materials animate by cycling through colors in the HSL color space.

Testing

  • I have tested these changes locally on my Linux machine.
  • Reviewers can test the changes by running the example with different grid sizes and observing the performance (FPS, frame time).
  • I have not tested on other platforms (macOS, Windows, wasm), but I expect it to work as the code uses standard Bevy features.

Showcase

Click to view showcase

image

Migration Guide

This PR does not introduce any breaking changes. It only adds a new example, so no migration is required.

Copy link
Contributor

The generated examples/README.md is out of sync with the example metadata in Cargo.toml or the example readme template. Please run cargo run -p build-templated-pages -- update examples to update it, and commit the file change.

Copy link
Contributor

@greeble-dev greeble-dev left a comment

Choose a reason for hiding this comment

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

Tested on Windows/Nvidia with no issues. Added a few non-blocking suggestions.

examples/stress_tests/many_materials.rs Outdated Show resolved Hide resolved
examples/stress_tests/many_materials.rs Outdated Show resolved Hide resolved
examples/stress_tests/many_materials.rs Outdated Show resolved Hide resolved
@IQuick143 IQuick143 added A-Rendering Drawing game state to the screen C-Examples An addition or correction to our examples C-Benchmarks Stress tests and benchmarks used to measure how fast things are D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jan 15, 2025
- Removed ground plane as it was unnecessary.
- Adjusted camera position for a better view.
- Reused mesh handle to improve performance.
- Regenerated examples README using `cargo run -p build-templated-pages -- update examples`.
@CrazyRoka
Copy link
Contributor Author

I've addressed the feedback in a new commit. Please take another look when you have time. Thanks!

@greeble-dev
Copy link
Contributor

Re-tested with the changes. Looks good!

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-Benchmarks Stress tests and benchmarks used to measure how fast things are 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
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

Add a stress test for animating materials
3 participants