From 0e6330d31320373b38907b9867df2e10023ccb4d Mon Sep 17 00:00:00 2001 From: ForTehLose Date: Fri, 16 Aug 2024 16:12:34 -0400 Subject: [PATCH] added system for cascading shadow maps --- crates/bevy_xr/src/camera.rs | 7 +++++++ 1 file changed, 7 insertions(+) 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(),