Rendering before main pass
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 161
Description
## Bevy version
0.11.2
## Relevant system information
`cargo --version`:
```ignore
cargo 1.71.1 (7f1d04c00 2023-07-29)
```
`uname -a`:
```ignore
Linux 6.1.44-1-MANJARO #1 SMP PREEMPT_DYNAMIC Wed Aug 9 09:02:26 UTC 2023 x86_64 GNU/Linux
```
```ignore
AdapterInfo { name: "NVIDIA GeForce GTX 650", vendor: 4318, device: 4038, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "470.199.02", backend: Vulkan }
```
```ignore
SystemInfo { os: "Linux 23.0.0 Manjaro Linux", kernel: "6.1.44-1-MANJARO", cpu: "AMD Ryzen 5 1600 Six-Core Processor", core_count: "6", memory: "7.7 GiB" }
```
## What you did
I want to set gradient as background color. So i made render node and inserted it between `PREPASS` and `BEGIN_MAIN_PASS`.
I also set camera clear config to `None`. I expected my shader to generate gradient and after that camera won't clear color and draw meshes on top of it. But it is not the case: color is black.
Then i searched for the workaround. I added another camera thet renders just the gradient and set it's priority to `-1`. Doesn't work also.
But then i set camera's clear color config to `Color::WHITE` and now it sometimes shows gradient and sometimes shows white color. I couldn't find a way to resolve this inconsistency.
code: https://github.com/necromfox/bevy_before_main_pass
## What went wrong
Expected main pass to preserve color written before it if camera render config set to `None`.
Instead it does not.
## Additional information
I found that bevy used to have `ClearPass` one day, but i couldn't find it in the present.
## Screenshots
№1: clear color config set to `None`

№2: clear color config set to `Color::WHITE`, sometimes it works...:

№3: clear color config set to `Color::WHITE`, ...and sometimes it does not:

Also white background appears often than gradient background
Contributor guide
Assessment
This issue has not been assessed yet.