use bevy::prelude::*; use bevy_video_glitch::*; fn main() { App::new() .add_plugins((DefaultPlugins, VideoGlitchPlugin)) .add_systems(Startup, setup) .add_systems(Update, (rotate, update_settings)) .run(); } /// Set up a simple 3D scene fn setup( mut commands: Commands, mut meshes: ResMut>, mut materials: ResMut>, ) { // camera commands.spawn(( Camera3dBundle { transform: Transform::from_translation(Vec3::new(0.0, 0.0, 5.0)) .looking_at(Vec3::default(), Vec3::Y), camera: Camera { clear_color: Color::WHITE.into(), ..default() }, ..default() }, // Add the setting to the camera. // // This component is also used to determine on which camera to run the // post processing effect. VideoGlitchSettings { intensity: 0.02, color_aberration: Mat3::from_cols_array(&[0.5, 0.5, 0.0, 0.0, 0.5, 0.5, 0.5, 0.0, 0.5]) .transpose(), }, )); // cube commands.spawn(( PbrBundle { mesh: meshes.add(Mesh::from(Cuboid::from_length(1.0))), material: materials.add(Color::srgb(0.8, 0.7, 0.6)), transform: Transform::from_xyz(0.0, 0.5, 0.0), ..default() }, Rotates, )); // light commands.spawn(PointLightBundle { transform: Transform::from_translation(Vec3::new(0.0, 0.0, 10.0)), ..default() }); } #[derive(Component)] struct Rotates; /// Rotates any entity around the x and y axis fn rotate(time: Res