Add option to animate materials in many_cubes #17927
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds an option to animate the materials in the
many_cubes
stress test. Each material instancebase_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 thebase_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 usingbase_color.set_hue(hue)
in the tight loop.