//! Demonstrates how to rotate the skybox and the environment map simultaneously. use std::f32::consts::PI; use bevy::{ color::palettes::css::{GOLD, WHITE}, core_pipeline::{tonemapping::Tonemapping::AcesFitted, Skybox}, prelude::*, render::texture::ImageLoaderSettings, }; /// Entry point. pub fn main() { App::new() .add_plugins(DefaultPlugins) .add_systems(Startup, setup) .add_systems(Update, rotate_skybox_and_environment_map) .run(); } /// Initializes the scene. fn setup( mut commands: Commands, mut meshes: ResMut>, mut materials: ResMut>, asset_server: Res, ) { let sphere_mesh = create_sphere_mesh(&mut meshes); spawn_sphere(&mut commands, &mut materials, &asset_server, &sphere_mesh); spawn_light(&mut commands); spawn_camera(&mut commands, &asset_server); } /// Rotate the skybox and the environment map per frame. fn rotate_skybox_and_environment_map( mut environments: Query<(&mut Skybox, &mut EnvironmentMapLight)>, time: Res