From fc98664d3df31c8dc47e74b61c7ec2ba21aa80f1 Mon Sep 17 00:00:00 2001 From: Lucas Franca Date: Tue, 11 Feb 2025 19:21:04 -0300 Subject: [PATCH] Add tonemapping switch to bloom 2d example (#17789) # Objective Allow switching through available Tonemapping algorithms on `bloom_2d` example to compare between them ## Solution Add a resource to `bloom_2d` that holds current tonemapping algorithm, a method to get the next one, and a check of key press to make the switch ## Testing Ran `bloom_2d` example with modified code ## Showcase https://github.com/user-attachments/assets/920b2d6a-b237-4b19-be9d-9b651b4dc913 Note: Sprite flashing is already described in #17763 --- examples/2d/bloom_2d.rs | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/examples/2d/bloom_2d.rs b/examples/2d/bloom_2d.rs index 0fc22fa13f..fd90210d6f 100644 --- a/examples/2d/bloom_2d.rs +++ b/examples/2d/bloom_2d.rs @@ -73,16 +73,16 @@ fn setup( // ------------------------------------------------------------------------------------------------ fn update_bloom_settings( - camera: Single<(Entity, Option<&mut Bloom>), With>, + camera: Single<(Entity, &Tonemapping, Option<&mut Bloom>), With>, mut text: Single<&mut Text>, mut commands: Commands, keycode: Res>, time: Res