bevy/examples/stress_tests
ickshonpe 73447b6d72
many_buttons enhancements (#9712)
# Objective

`many_buttons` enhancements:
* use `argh` to manage the commandline arguments like the other stress
tests
* add an option to set the number of buttons
* add a grid layout option
* centre the grid properly
* use viewport coords for the layout's style constraints
* replace use of absolute positioning

includes the changes from #9636

Displaying an image isn't actually about stress testing image rendering.
Without a second texture (the first is used by the text) the entire grid
will be drawn in a single batch. The extra texture used by the image
forces the renderer to break up the batches at every button displaying
an image, where it has to switch between the font atlas texture and the
image texture.

## Solution

<img width="401" alt="many_buttons_new"
src="https://github.com/bevyengine/bevy/assets/27962798/82140c6d-d72c-4e4f-b9b6-dd204176e51d">

---

## Changelog

 `many_buttons` stress test example enhancements:
* uses `argh` to the manage the commandline arguments.
* New commandline args:
  - `--help` display info & list all commandline options
  - `--buttons`  set the number of buttons.
  - `--image-freq` set the frequency of buttons displaying images
  - `--grid` use a grid layout
* style constraints are specified in viewport coords insead of
percentage values
* margins and nested bundles are used to construct the layout, instead
of absolute positioning
* the button grid centered in the window, the empty gap along the bottom
and right is removed
* an image is drawn as the background to every Nth button where N is set
using the `--image-freq` commandline option.

---------

Co-authored-by: Rob Parrett <robparrett@gmail.com>
2023-09-08 15:02:05 +00:00
..
bevymark.rs Enhance bevymark (#9674) 2023-09-02 19:16:44 +00:00
many_animated_sprites.rs Allow tuples and single plugins in add_plugins, deprecate add_plugin (#8097) 2023-06-21 20:51:03 +00:00
many_buttons.rs many_buttons enhancements (#9712) 2023-09-08 15:02:05 +00:00
many_cubes.rs Enhance bevymark (#9674) 2023-09-02 19:16:44 +00:00
many_foxes.rs API updates to the AnimationPlayer (#9002) 2023-08-28 16:43:04 +00:00
many_gizmos.rs Fix CI for Rust 1.72 (#9562) 2023-08-25 12:34:24 +00:00
many_glyphs.rs use AutoNoVsync in stress tests (#9229) 2023-07-21 20:15:13 +00:00
many_lights.rs Allow tuples and single plugins in add_plugins, deprecate add_plugin (#8097) 2023-06-21 20:51:03 +00:00
many_sprites.rs Allow tuples and single plugins in add_plugins, deprecate add_plugin (#8097) 2023-06-21 20:51:03 +00:00
README.md Add a stress test profile (#6901) 2022-12-20 15:59:41 +00:00
text_pipeline.rs use AutoNoVsync in stress tests (#9229) 2023-07-21 20:15:13 +00:00
transform_hierarchy.rs Allow tuples and single plugins in add_plugins, deprecate add_plugin (#8097) 2023-06-21 20:51:03 +00:00
warning_string.txt Added performance warning when running stress test examples in debug mode (#5029) 2022-07-13 19:13:46 +00:00

Stress tests

These examples are used to stress test Bevy's performance in various ways. These should be run with the "stress-test" profile to accurately represent performance in production, otherwise they will run in cargo's default "dev" profile which is very slow.

Example Command

cargo run --profile stress-test --example <EXAMPLE>