Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions crates/bevy_pbr/src/ssao/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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,
Expand All @@ -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(
Expand Down