From e981bb8902f4954a51e68c1979532d8cd886d4ae Mon Sep 17 00:00:00 2001 From: Griffin <33357138+DGriffin91@users.noreply.github.com> Date: Tue, 27 May 2025 12:46:04 -0700 Subject: [PATCH] Make light cascades and tonemapping luts pub (#19189) Make directional light cascades and tonemapping luts pub so that custom render passes / backends can use them. --- crates/bevy_core_pipeline/src/tonemapping/mod.rs | 6 +++--- crates/bevy_pbr/src/light/mod.rs | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/crates/bevy_core_pipeline/src/tonemapping/mod.rs b/crates/bevy_core_pipeline/src/tonemapping/mod.rs index f546ef54d3..3e35926c2a 100644 --- a/crates/bevy_core_pipeline/src/tonemapping/mod.rs +++ b/crates/bevy_core_pipeline/src/tonemapping/mod.rs @@ -39,9 +39,9 @@ const TONEMAPPING_LUT_BINDINGS_SHADER_HANDLE: Handle = /// 3D LUT (look up table) textures used for tonemapping #[derive(Resource, Clone, ExtractResource)] pub struct TonemappingLuts { - blender_filmic: Handle, - agx: Handle, - tony_mc_mapface: Handle, + pub blender_filmic: Handle, + pub agx: Handle, + pub tony_mc_mapface: Handle, } pub struct TonemappingPlugin; diff --git a/crates/bevy_pbr/src/light/mod.rs b/crates/bevy_pbr/src/light/mod.rs index 91ea9cddd3..4ff4662bb2 100644 --- a/crates/bevy_pbr/src/light/mod.rs +++ b/crates/bevy_pbr/src/light/mod.rs @@ -300,22 +300,22 @@ impl From for CascadeShadowConfig { #[reflect(Component, Debug, Default, Clone)] pub struct Cascades { /// Map from a view to the configuration of each of its [`Cascade`]s. - pub(crate) cascades: EntityHashMap>, + pub cascades: EntityHashMap>, } #[derive(Clone, Debug, Default, Reflect)] #[reflect(Clone, Default)] pub struct Cascade { /// The transform of the light, i.e. the view to world matrix. - pub(crate) world_from_cascade: Mat4, + pub world_from_cascade: Mat4, /// The orthographic projection for this cascade. - pub(crate) clip_from_cascade: Mat4, + pub clip_from_cascade: Mat4, /// The view-projection matrix for this cascade, converting world space into light clip space. /// Importantly, this is derived and stored separately from `view_transform` and `projection` to /// ensure shadow stability. - pub(crate) clip_from_world: Mat4, + pub clip_from_world: Mat4, /// Size of each shadow map texel in world units. - pub(crate) texel_size: f32, + pub texel_size: f32, } pub fn clear_directional_light_cascades(mut lights: Query<(&DirectionalLight, &mut Cascades)>) {