Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add option to animate materials in many_cubes (#17927)
This adds an option to animate the materials in the `many_cubes` stress test. Each material instance `base_color` is varied each frame. This has been tested in conjunction with the `--vary-material-data-per-instance` and `--material-texture-count` options. If `--vary-material-data-per-instance` is not used it will just update the single material, otherwise it will update all of them. If `--material-texture-count` is used the `base_color` is multiplied with the texture so the effect is still visible. Because this test is focused on the performance of updating material data and not the performance of bevy's color system it uses its own function (`fast_hue_to_rgb`) to quickly set the hue. This appeared to be around 8x faster than using `base_color.set_hue(hue)` in the tight loop.
- Loading branch information