bevy/crates/bevy_render/src
Jakob Hellermann 838b318863 separate tonemapping and upscaling passes (#3425)
Attempt to make features like bloom https://github.com/bevyengine/bevy/pull/2876 easier to implement.

**This PR:**
- Moves the tonemapping from `pbr.wgsl` into a separate pass
- also add a separate upscaling pass after the tonemapping which writes to the swap chain (enables resolution-independant rendering and post-processing after tonemapping)
- adds a `hdr` bool to the camera which controls whether the pbr and sprite shaders render into a `Rgba16Float` texture

**Open questions:**
- ~should the 2d graph work the same as the 3d one?~ it is the same now
- ~The current solution is a bit inflexible because while you can add a post processing pass that writes to e.g. the `hdr_texture`, you can't write to a separate `user_postprocess_texture` while reading the `hdr_texture` and tell the tone mapping pass to read from the `user_postprocess_texture` instead. If the tonemapping and upscaling render graph nodes were to take in a `TextureView` instead of the view entity this would almost work, but the bind groups for their respective input textures are already created in the `Queue` render stage in the hardcoded order.~ solved by creating bind groups in render node

**New render graph:**

![render_graph](https://user-images.githubusercontent.com/22177966/147767249-57dd4229-cfab-4ec5-9bf3-dc76dccf8e8b.png)
<details>
<summary>Before</summary>

![render_graph_old](https://user-images.githubusercontent.com/22177966/147284579-c895fdbd-4028-41cf-914c-e1ffef60e44e.png)
</details>

Co-authored-by: Carter Anderson <mcanders1@gmail.com>
2022-10-26 20:13:59 +00:00
..
camera separate tonemapping and upscaling passes (#3425) 2022-10-26 20:13:59 +00:00
color Correctly use as_hsla_f32 in Add<Color> and AddAssign<Color>, fixes #5543 (#5546) 2022-08-17 14:00:10 +00:00
mesh Prepare for upcoming rustlang by fixing upcoming clippy warnings (#6376) 2022-10-26 19:15:15 +00:00
primitives Very minor doc formatting changes (#5287) 2022-07-12 13:06:16 +00:00
render_graph fix: grammar and typo fixes in rendergraph docs (#5710) 2022-08-16 20:46:46 +00:00
render_phase remove copyless (#6100) 2022-09-27 18:11:40 +00:00
render_resource log pipeline cache errors earlier (#6115) 2022-09-28 04:04:55 +00:00
renderer separate tonemapping and upscaling passes (#3425) 2022-10-26 20:13:59 +00:00
texture separate tonemapping and upscaling passes (#3425) 2022-10-26 20:13:59 +00:00
view separate tonemapping and upscaling passes (#3425) 2022-10-26 20:13:59 +00:00
extract_component.rs Implement IntoIterator for &Extract<P> (#6025) 2022-09-20 00:29:10 +00:00
extract_param.rs Exclusive Systems Now Implement System. Flexible Exclusive System Params (#6083) 2022-09-26 23:57:07 +00:00
extract_resource.rs Prepare for upcoming rustlang by fixing upcoming clippy warnings (#6376) 2022-10-26 19:15:15 +00:00
globals.rs Add global time scaling (#5752) 2022-10-22 18:52:29 +00:00
lib.rs separate tonemapping and upscaling passes (#3425) 2022-10-26 20:13:59 +00:00
rangefinder.rs Very minor doc formatting changes (#5287) 2022-07-12 13:06:16 +00:00
render_asset.rs Make Resource trait opt-in, requiring #[derive(Resource)] V2 (#5577) 2022-08-08 21:36:35 +00:00
settings.rs Make Resource trait opt-in, requiring #[derive(Resource)] V2 (#5577) 2022-08-08 21:36:35 +00:00
spatial_bundle.rs Add associated constant IDENTITY to Transform and friends. (#5340) 2022-08-30 22:10:24 +00:00