bevy/examples/stress_tests
IceSentry 9de25ad330
Add AlphaMask2d phase (#14724)
# Objective

- Bevy now supports an opaque phase for mesh2d, but it's very common for
2d textures to have a transparent alpha channel.

## Solution

- Add an alpha mask phase identical to the one in 3d. It will do the
alpha masking in the shader before drawing the mesh.
- Uses the BinnedRenderPhase
- Since it's an opaque draw it also correctly writes to depth

## Testing

- Tested the mes2d_alpha_mode example and the bevymark example with
alpha mask mode enabled

---

## Showcase


![image](https://github.com/user-attachments/assets/9e5e4561-d0a7-4aa3-b049-d4b1247d5ed4)

The white logo on the right is rendered with alpha mask enabled.

Running the bevymark example I can get 65fps for 120k mesh2d all using
alpha mask.

## Notes

This is one more step for mesh2d improvements
https://github.com/bevyengine/bevy/issues/13265

---------

Co-authored-by: Kristoffer Søholm <k.soeholm@gmail.com>
2024-08-15 14:10:37 +00:00
..
bevymark.rs Add AlphaMask2d phase (#14724) 2024-08-15 14:10:37 +00:00
many_animated_sprites.rs Remove redundant imports (#12817) 2024-04-01 19:59:08 +00:00
many_buttons.rs fix remaining issues with background color in examples (#14115) 2024-07-03 01:13:55 +00:00
many_cubes.rs Implement GPU frustum culling. (#12889) 2024-04-28 12:50:00 +00:00
many_foxes.rs glTF labels: add enum to avoid misspelling and keep up-to-date list documented (#13586) 2024-05-31 23:25:57 +00:00
many_gizmos.rs Apply Clippy lints regarding lazy evaluation and closures (#14015) 2024-07-01 15:54:40 +00:00
many_glyphs.rs Cosmic text (#10193) 2024-07-04 20:41:08 +00:00
many_lights.rs Rename "point light" to "clusterable object" in cluster contexts. (#13654) 2024-06-04 11:01:13 +00:00
many_sprites.rs Remove redundant imports (#12817) 2024-04-01 19:59:08 +00:00
README.md Add a stress test profile (#6901) 2022-12-20 15:59:41 +00:00
text_pipeline.rs Cosmic text (#10193) 2024-07-04 20:41:08 +00:00
transform_hierarchy.rs Fix tracing with transform_hierarchy example (#14374) 2024-07-20 16:38:24 +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>