Skip to content

Commit f21114a

Browse files
authored
ssr fix and add some documents (#21877)
# Objective Screen space reflection didn't work for my program, so I tried cloning bevy repo and running the ssr example to see whether it works or not, and it didn't. I figured out that the problem is that `prepare_ssr_pipelines` system only runs for views with `ExtractedAtmosphere`. So I removed this filter because it already uses `Has<ExtractedAtmosphere>`. And the example works afterwards. I later found that the `With<ExtractedAtmosphere>` filter is not added to bevy 0.17, so the problem in my own program is not the same as the ssr example. I compared the ssr example and my program and found that I didn't add `DefaultOpaqueRendererMethod::deferred()` resource. So I added a few docs to state that deferred rendering is not automatically enabled when ssr is added. ## Solution 1. remove `With<ExtractedAtmosphere>` filter in `prepare_ssr_pipelines`. 2. add more documentation. ## Testing I tested the ssr example and atmosphere example and both look fine.
1 parent afae1c0 commit f21114a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crates/bevy_pbr/src/ssr/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ pub struct ScreenSpaceReflectionsPlugin;
6262
///
6363
/// Screen-space reflections currently require deferred rendering in order to
6464
/// appear. Therefore, they also need the [`DepthPrepass`] and [`DeferredPrepass`]
65-
/// components, which are inserted automatically.
65+
/// components, which are inserted automatically,
66+
/// but deferred rendering itself is not automatically enabled.
6667
///
6768
/// SSR currently performs no roughness filtering for glossy reflections, so
6869
/// only very smooth surfaces will reflect objects in screen space. You can
@@ -428,7 +429,6 @@ pub fn prepare_ssr_pipelines(
428429
With<ScreenSpaceReflectionsUniform>,
429430
With<DepthPrepass>,
430431
With<DeferredPrepass>,
431-
With<ExtractedAtmosphere>,
432432
),
433433
>,
434434
) {

0 commit comments

Comments
 (0)