bevyengine / bevy

A refreshingly simple data-driven game engine built in Rust
https://bevyengine.org
Apache License 2.0
34.34k stars 3.35k forks source link

Rendering before main pass #9585

Open aleqdev opened 11 months ago

aleqdev commented 11 months ago

Bevy version

0.11.2

Relevant system information

cargo --version:

cargo 1.71.1 (7f1d04c00 2023-07-29)

uname -a:

Linux 6.1.44-1-MANJARO #1 SMP PREEMPT_DYNAMIC Wed Aug  9 09:02:26 UTC 2023 x86_64 GNU/Linux
AdapterInfo { name: "NVIDIA GeForce GTX 650", vendor: 4318, device: 4038, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "470.199.02", backend: Vulkan }
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)

№2: clear color config set to Color::WHITE, sometimes it works...: image (3)

№3: clear color config set to Color::WHITE, ...and sometimes it does not: image (4)

Also white background appears often than gradient background

termisaal commented 11 months ago

skill issue

alice-i-cecile commented 11 months ago

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.

Do you mean that this behavior varies between runs of the app? If so, I suspect this is a system order ambiguity bug.

aleqdev commented 11 months ago

Yes, it varies between runs. If it is system order bug, then is must be internal to the engine, because in my example i have only one startup system

alice-i-cecile commented 11 months ago

Yep, I suspect this is related to #9511 then. I know @superdump just refactored the render schedule on main: perhaps he'll have insight here.

cart commented 11 months ago

I've blocked @termisaal from participating in bevy repos. Unacceptable behavior.