Support Warning
WebGPU is currently only supported on Chrome starting with version 113, and only on desktop. If they don't work on your configuration, you can check the WebGL2 examples here.post_processing.rs:
//! Demonstrates Bevy's built-in postprocessing features.
//!
//! Currently, this simply consists of chromatic aberration.
use PI;
use ;
/// The number of units per frame to add to or subtract from intensity when the
/// arrow keys are held.
const CHROMATIC_ABERRATION_INTENSITY_ADJUSTMENT_SPEED: f32 = 0.002;
/// The maximum supported chromatic aberration intensity level.
const MAX_CHROMATIC_ABERRATION_INTENSITY: f32 = 0.4;
/// The settings that the user can control.
/// The entry point.
/// Creates the example scene and spawns the UI.
/// Spawns the camera, including the [`ChromaticAberration`] component.
/// Spawns the scene.
///
/// This is just the tonemapping test scene, chosen for the fact that it uses a
/// variety of colors.
/// Spawns the help text at the bottom of the screen.
/// Creates help text at the bottom of the screen.
/// Handles requests from the user to change the chromatic aberration intensity.
/// Updates the [`ChromaticAberration`] settings per the [`AppSettings`].
/// Updates the help text at the bottom of the screen to reflect the current
/// [`AppSettings`].