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.
This commit is contained in:
Griffin 2025-05-27 12:46:04 -07:00 committed by GitHub
parent 8e585174ee
commit e981bb8902
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 8 deletions

View File

@ -39,9 +39,9 @@ const TONEMAPPING_LUT_BINDINGS_SHADER_HANDLE: Handle<Shader> =
/// 3D LUT (look up table) textures used for tonemapping /// 3D LUT (look up table) textures used for tonemapping
#[derive(Resource, Clone, ExtractResource)] #[derive(Resource, Clone, ExtractResource)]
pub struct TonemappingLuts { pub struct TonemappingLuts {
blender_filmic: Handle<Image>, pub blender_filmic: Handle<Image>,
agx: Handle<Image>, pub agx: Handle<Image>,
tony_mc_mapface: Handle<Image>, pub tony_mc_mapface: Handle<Image>,
} }
pub struct TonemappingPlugin; pub struct TonemappingPlugin;

View File

@ -300,22 +300,22 @@ impl From<CascadeShadowConfigBuilder> for CascadeShadowConfig {
#[reflect(Component, Debug, Default, Clone)] #[reflect(Component, Debug, Default, Clone)]
pub struct Cascades { pub struct Cascades {
/// Map from a view to the configuration of each of its [`Cascade`]s. /// Map from a view to the configuration of each of its [`Cascade`]s.
pub(crate) cascades: EntityHashMap<Vec<Cascade>>, pub cascades: EntityHashMap<Vec<Cascade>>,
} }
#[derive(Clone, Debug, Default, Reflect)] #[derive(Clone, Debug, Default, Reflect)]
#[reflect(Clone, Default)] #[reflect(Clone, Default)]
pub struct Cascade { pub struct Cascade {
/// The transform of the light, i.e. the view to world matrix. /// 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. /// 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. /// 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 /// Importantly, this is derived and stored separately from `view_transform` and `projection` to
/// ensure shadow stability. /// ensure shadow stability.
pub(crate) clip_from_world: Mat4, pub clip_from_world: Mat4,
/// Size of each shadow map texel in world units. /// 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)>) { pub fn clear_directional_light_cascades(mut lights: Query<(&DirectionalLight, &mut Cascades)>) {