diff --git a/crates/bevy_xr/src/camera.rs b/crates/bevy_xr/src/camera.rs index 35bb419..5f64fc1 100644 --- a/crates/bevy_xr/src/camera.rs +++ b/crates/bevy_xr/src/camera.rs @@ -7,6 +7,7 @@ use bevy::ecs::component::Component; use bevy::ecs::reflect::ReflectComponent; use bevy::ecs::schedule::IntoSystemConfigs; use bevy::math::{Mat4, Vec3A}; +use bevy::pbr::{build_directional_light_cascades, clear_directional_light_cascades, SimulationLightSystems}; use bevy::reflect::std_traits::ReflectDefault; use bevy::reflect::Reflect; use bevy::render::camera::{ @@ -30,6 +31,12 @@ impl Plugin for XrCameraPlugin { .after(TransformSystem::TransformPropagate) .before(VisibilitySystems::UpdateFrusta), ); + app.add_systems( + PostUpdate, + build_directional_light_cascades:: + .in_set(SimulationLightSystems::UpdateDirectionalLightCascades) + .after(clear_directional_light_cascades), + ); app.add_plugins(( ExtractComponentPlugin::::default(), ExtractComponentPlugin::::default(),