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

[Merged by Bors] - Cleanup many sprites stress tests #7436

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions examples/stress_tests/many_animated_sprites.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
//! Renders a lot of animated sprites to allow performance testing.
//!
//! It sets up many animated sprites in different sizes and rotations, and at different scales in the world,
//! and moves the camera over them to see how well frustum culling works.
//! It sets up many animated sprites in different sizes and rotations,
//! and at different scales in the world, and moves the camera over them.
//!
//! To measure performance realistically, be sure to run this in release mode.
//! `cargo run --example many_animated_sprites --release`
//! Having sprites out of the camera's field of view should also help stress
//! test any future potential 2d frustum culling implementation.

use std::time::Duration;

Expand All @@ -24,7 +24,13 @@ fn main() {
// Since this is also used as a benchmark, we want it to display performance data.
.add_plugin(LogDiagnosticsPlugin::default())
.add_plugin(FrameTimeDiagnosticsPlugin::default())
.add_plugins(DefaultPlugins)
.add_plugins(DefaultPlugins.set(WindowPlugin {
primary_window: Some(Window {
present_mode: PresentMode::AutoNoVsync,
..default()
}),
..default()
}))
.add_startup_system(setup)
.add_system(animate_sprite)
.add_system(print_sprite_count)
Expand All @@ -37,6 +43,8 @@ fn setup(
assets: Res<AssetServer>,
mut texture_atlases: ResMut<Assets<TextureAtlas>>,
) {
warn!(include_str!("warning_string.txt"));
nicopap marked this conversation as resolved.
Show resolved Hide resolved

let mut rng = rand::thread_rng();

let tile_size = Vec2::splat(64.0);
Expand Down
7 changes: 5 additions & 2 deletions examples/stress_tests/many_sprites.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
//! Renders a lot of sprites to allow performance testing.
//! See <https://github.com/bevyengine/bevy/pull/1492>
//!
//! It sets up many sprites in different sizes and rotations, and at different scales in the world,
//! and moves the camera over them to see how well frustum culling works.
//! It sets up many animated sprites in different sizes and rotations,
//! and at different scales in the world, and moves the camera over them.
//!
//! Having sprites out of the camera's field of view should also help stress
//! test any future potential 2d frustum culling implementation.
//!
//! Add the `--colored` arg to run with color tinted sprites. This will cause the sprites to be rendered
//! in multiple batches, reducing performance but useful for testing.
Expand Down