bevyengine / bevyengine/bevy

Rendering before main pass

Open
#9,585 5 comments 0 reactions 0 assignees View on GitHub
A-Rendering C-Bug
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`
![image (2)](https://github.com/bevyengine/bevy/assets/76201108/e321e61c-a6ce-473c-bc5c-5c74af8477b5)

№2: clear color config set to `Color::WHITE`, sometimes it works...:
![image (3)](https://github.com/bevyengine/bevy/assets/76201108/e33375af-51dc-40d9-9f09-504f32b43adc)

№3: clear color config set to `Color::WHITE`, ...and sometimes it does not:
![image (4)](https://github.com/bevyengine/bevy/assets/76201108/dacb6a5a-2fce-4f56-8889-2055661eb674)

Also white background appears often than gradient background

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.