forked from bevyengine/bevy-website
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
79a5b7a
commit 2d94a80
Showing
2 changed files
with
21 additions
and
2 deletions.
There are no files selected for viewing
21 changes: 20 additions & 1 deletion
21
...lease-notes/13418_Implement_optin_sharp_screenspace_reflections_for_the_defe.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,23 @@ | ||
<!-- Implement opt-in sharp screen-space reflections for the deferred renderer, with improved raymarching code. --> | ||
<!-- https://github.com/bevyengine/bevy/pull/13418 --> | ||
|
||
<!-- TODO --> | ||
[Screen-space reflections](https://lettier.github.io/3d-game-shaders-for-beginners/screen-space-reflection.html) approximate real-time reflections by raymarching through the depth buffer and copying samples from the final rendered frame. | ||
Our initial implementation is relatively minimal, to provide a flexible base to build on, but is based on the production-quality [raymarching code by Tomasz Stachowiak](https://gist.github.com/h3r2tic/9c8356bdaefbe80b1a22ae0aaee192db), one of the creators of the indie darling Bevy game [Tiny Glade](https://store.steampowered.com/app/2198150/Tiny_Glade/). | ||
As a result, there are a few caveats to bear in mind: | ||
|
||
1. Currently, this feature is built on top of the deferred renderer and is currently only supported in that mode. Forward screen-space reflections are possible albeit uncommon (though e.g. Doom Eternal uses them); however, they require tracing from the previous frame, which would add complexity. This patch leaves the door open to implementing SSR in the forward rendering path but doesn't itself have such an implementation. | ||
2. Screen-space reflections aren't supported in WebGL 2, because they require sampling from the depth buffer, which `naga` can't do because of a bug (sampler2DShadow is incorrectly generated instead of sampler2D; this is the same reason why depth of field is disabled on that platform). | ||
3. No temporal filtering or roughness blurring is performed at all. For this reason, SSR currently only operates on very shiny surfaces. | ||
4. We don't perform acceleration via the hierarchical Z-buffer and reflections are traced at full resolution. As a result, you may notice performance issues depending on your scene and hardware. | ||
|
||
![A cube with the Bevy logo on all 6 sides sits on top of rippling water. Sharp reflections are visible, distorted by the uneven surface of the water.](screen_space_reflections.png) | ||
|
||
To add screen-space reflections to a camera, insert the [`ScreenSpaceReflectionsSettings`] component. | ||
In addition to [`ScreenSpaceReflectionsSettings`], [`DepthPrepass`] and [`DeferredPrepass`] must also be present for the reflections to show up. | ||
Conveniently, the [`ScreenSpaceReflectionsBundle`] bundles these all up for you! | ||
While the [`ScreenSpaceReflectionsSettings`] comes with sensible defaults, it also contains several settings that artists can tweak. | ||
|
||
[`ScreenSpaceReflectionsBundle`]: https://dev-docs.bevyengine.org/bevy/pbr/struct.ScreenSpaceReflectionsBundle.html | ||
[`ScreenSpaceReflectionsSettings`]:https://dev-docs.bevyengine.org/bevy/pbr/struct.ScreenSpaceReflectionsSettings.html | ||
[`DepthPrepass`]: https://dev-docs.bevyengine.org/bevy/core_pipeline/prepass/struct.DepthPrepass.html | ||
[`DeferredPrepass`]: https://dev-docs.bevyengine.org/bevy/core_pipeline/prepass/struct.DeferredPrepass.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters