diff --git a/crates/bevy_pbr/src/ssao/mod.rs b/crates/bevy_pbr/src/ssao/mod.rs index 65a200c70f..3486c49999 100644 --- a/crates/bevy_pbr/src/ssao/mod.rs +++ b/crates/bevy_pbr/src/ssao/mod.rs @@ -111,6 +111,7 @@ impl Plugin for ScreenSpaceAmbientOcclusionPlugin { #[derive(Component, ExtractComponent, Reflect, PartialEq, Clone, Debug)] #[reflect(Component, Debug, Default, PartialEq, Clone)] #[require(DepthPrepass, NormalPrepass)] +#[extract_component_sync_target((Self, ScreenSpaceAmbientOcclusionResources, SsaoPipelineId, SsaoBindGroups))] #[doc(alias = "Ssao")] pub struct ScreenSpaceAmbientOcclusion { /// Quality of the SSAO effect. @@ -598,8 +599,9 @@ fn prepare_ssao_textures( } } +/// A render world component that holds the cached pipeline id for Ssao. #[derive(Component)] -struct SsaoPipelineId(CachedComputePipelineId); +pub struct SsaoPipelineId(pub CachedComputePipelineId); fn prepare_ssao_pipelines( mut commands: Commands, @@ -622,12 +624,16 @@ fn prepare_ssao_pipelines( } } +/// A render world component that stores the bind groups necessary to perform +/// Screen Space Ambient Occlusion. +/// +/// This is stored on each view. #[derive(Component)] -struct SsaoBindGroups { - common_bind_group: BindGroup, - preprocess_depth_bind_group: BindGroup, - ssao_bind_group: BindGroup, - spatial_denoise_bind_group: BindGroup, +pub struct SsaoBindGroups { + pub common_bind_group: BindGroup, + pub preprocess_depth_bind_group: BindGroup, + pub ssao_bind_group: BindGroup, + pub spatial_denoise_bind_group: BindGroup, } fn prepare_ssao_bind_groups(