-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rendering issue at the boundary of the clear color #2374
Comments
I have the hunch that this is because of transparency ending up in the swap chain image. Using a separate OP for blending the alpha channel might fix it if this is really the case. |
@CptPotato it's a bit out of my league to come up with a solution to this problem, but I can definitely run some tests if you have an idea as to where the problem lies. |
@allsey87 would you happen to have the code to reproduce this somewhere available? |
@mockersf for the white outline between the meshes and clear color, I can see it when I pull the main branch and run the 3d_scene example with Tomorrow, I will add an egui window on top of this and post the code and screenshots for it. |
By the way, I get this warning when I run Bevy examples and apps:
Probably nothing, but I am making a note of it since it is related to graphics. |
@allsey87 I believe that latest note is more of a configuration thing for your computer. At least for me, I got that same message for many applications. Luckily I recorded what I did to do the configuration the message suggests:
|
You don't have to do this if you don't actually want to measure the performance of rendering beyond fps or don't want to measure it at all. |
Oh, definitely not what I'm seeing, even your clear color seems wrong, it should be |
It was mentioned on discord that this may be a case of #419. Could you check by playing with the msaa parameter? |
@mockersf you are correct. Setting Issue gfx-rs/wgpu#725 reports this problem, specifically calling out Linux and Intel graphics chips. |
I'm also seeing the same issue with Bevy 0.7 on Linux Mint 20.3 on a Thinkpad with an Intel UHD Graphics 620 with the vulkan x11 backend, the drivers I'm using are the Mesa Intel ones. glxinfo shows this for my drivers: |
As mentioned in #7126, I get a similar issue running the |
That's weird. I just tried an even simpler example, setting MSAA to 1 instead of 4 changes the color of the default background. Surely, that's not intended? Should I report a second bug? use bevy::{prelude::*, sprite::MaterialMesh2dBundle};
fn main() {
App::new()
.insert_resource(Msaa { samples: 1 }) // removing this line changes the background color
.add_plugins(DefaultPlugins)
.add_startup_system(setup)
.run();
}
fn setup(
mut commands: Commands,
mut meshes: ResMut<Assets<Mesh>>,
mut materials: ResMut<Assets<ColorMaterial>>,
) {
commands.spawn(Camera2dBundle::default());
} |
Hi, I can confirm I'm having the same issue on a Linux laptop with UHD620 graphics. Bevy 0.11.3 and X11 on a fresh debian 12 install. The background / clear color only seems to be rendered correctly when a fragment with an alpha of some kind sits atop of it or is in the vicinity (~4 pixels away max). |
I am also being affected by this issue in Bevy 0.13.2 on Linux, Wayland. My adapter is "Intel HD Graphics 520 (SKL GT2)". Just the same as everyone here, with MSAA on (the default) the clear color is darker (pretty much black), and blending with the clear color adds a weird outline. Blending sprites together doesn't seem to produce this effect (layering transparent sprites on top of each other) though this might just be because the transparency is so weak. It almost looks like the blended part is the correct color, and the only problem is the cleared area is the wrong color. Thankfully turning MSAA off fixes it like others, and practically most completed games will avoid the clear color entirely, so this is likely just a dev issue. |
Bevy version
0.5.0
Operating system & version
Arch Linux (5.12.9-arch1-1) running on a Toshiba laptop with Intel UHD Graphics 620 graphics.
What you did
Created a simple scene with a couple of meshes representing a floor and two boxes, although the problem was also recreated by just running the examples from bevy-inspector-egui.
What you expected to happen
The shadows from the egui widgets should blend nicely with the clear color set by
AppBuilder
'sinsert_resource(ClearColor(...))
. Similarly, I suspect the meshes in my scene should not have this fine white outline where they transition from the mesh to the clear color.What actually happened
The shadows from the egui widgets and the outline of the meshes interact strangely with the clear color. When changing the clear color dynamically using the widgets in the bevy-inspector-egui
world
example, it appears that the pixels in question are picking up the clear color but at a brightness several times higher than it should be.Additional information
This problem is present either the X11 or Wayland features enabled on the Bevy crate (see below) and is present with/without egui/egui_bevy included in the project.
Screenshot from Wayland
Screenshot from X11
The text was updated successfully, but these errors were encountered: