-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
many_buttons
enhancements
#9712
many_buttons
enhancements
#9712
Conversation
* uses `argh` to the manage the commandline arguments. * New commandline args: - `--help` display help - `--buttons` set the number of buttons. - `--image-freq` set the frequency of buttons displaying images *
* uses `argh` to the manage the commandline arguments. * New commandline args: - `--help` display help - `--buttons` set the number of buttons. - `--image-freq` set the frequency of buttons displaying images * 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 grid of buttons is centered in the window, the empty gap along the bottom and right is removed
…npe/bevy into many-buttons-enhancements
…list lines up nicely
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CLI interface looks nice :) And the enhancements will be useful for more precise benchmarking without exploding our set of stress tests.
Some thoughts:
Here's a branch with |
Co-authored-by: Rob Parrett <[email protected]>
Not really, with a square window you get square buttons but it doesn't matter. I hadn't considered the examples page, I'll change it to the default. |
…npe/bevy into many-buttons-enhancements
Won't this do the opposite, will the buttons disappear with a lot of buttons? Maybe it would be better to merge this as it is? The changes here (if not ideal) are a big improvement on main. Then you could create a second PR as I'm sure you know more about the grid layout model than me etc. |
Yeah, that's fair, especially at the particular sizes I chose.
I had some vague notion that rendering zero-pixel-width geometry might have different performance characteristics but I doubt that is how it works or that it matters if it is. (and even at 100k buttons the borders are at least ~0.1 pixels)
Not a blocker for me. |
It might add some additional utility if those modes were producing identical output, but I am not completely convinced that's even possible. Might require a greater flexbox wizard than me. |
# 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 bevyengine#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 <[email protected]>
Objective
many_buttons
enhancements:argh
to manage the commandline arguments like the other stress testsincludes 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
Changelog
many_buttons
stress test example enhancements:argh
to the manage the commandline arguments.--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--image-freq
commandline option.