-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
MSAA causing render artefacts in Sprites #3593
Comments
The png is 768x99 pixels, loading the atlas with these parameters works as expected: |
Yeah, I just found that bug too and fixed it. That doesn't fix the render artefacts though. |
That's strange, this commit did fix it for me. |
Actually, I don't have any artefacts on the previous commit (v0.8.0) either, it only had the size issue. I can't reproduce. Could you detail your OS and GPU? |
I added some |
Is this related to #3423? Not seeing this on windows/nvidia or mac/m1 |
I think the only rendering change for sprites in this commit is enabling MSAA. Could you try to disable it? app.insert_resource(Msaa { samples: 1 }) |
That fixes it for me |
The darkened colors suggest this issue may have been caused by Bevy picking an incorrect surface format, which should be fixed on |
I can still reproduce this on fdec72b |
is the background color change also just from the msaa change? |
It is for me anyway! |
Yes |
Seems everyone affected is on Linux with an Intel integrated GPU It looks like gfx-rs/wgpu#725 came back... @cwfitzgerald are you aware if that's the case? |
I can no longer reproduce this, but my hardware has changed. Can someone with hardware that had the issue in previous versions check 0.12 please? |
Confirmed still happening for me on 0.12 with the same Intel Integrated GPU, Pop OS laptop |
Same here. Left is using It seems as though with MSAA, sRGB transformation is applied twice. When I use Adapter as reported by Bevy:
Minimal reproducer I useduse bevy::prelude::*;
fn main() {
App::new()
.insert_resource(ClearColor(Color::GRAY))
.insert_resource(Msaa::Sample2) // Or Msaa::Off respectively
.add_plugins(DefaultPlugins.set(WindowPlugin {
primary_window: Some(Window {
title: "Msaa::Sample2".to_string(),
present_mode: bevy::window::PresentMode::AutoVsync,
resizable: true,
..Default::default()
}),
..Default::default()
}))
.add_systems(Startup, startup)
.run();
}
fn startup(mut commands: Commands) {
commands.spawn(Camera2dBundle::default());
} |
For those who are experiencing this on vulkan, can you make sure your graphics drivers are up to date? We use this ppa https://github.com/gfx-rs/wgpu/blob/trunk/.github/workflows/ci.yml#L402 to get the latest stable release of Mesa. If this is still a problem on an updated Mesa, this is a bug to file against Mesa itself. |
@cwfitzgerald The issue indeed persists with the latest Mesa (23.1.9 at the time of writing). I am not sure it is a problem with the driver, however. To have something to compare against, I adapted As the clear value, I used the same clear_values: vec![Some([0.5, 0.5, 0.5, 1.0].into()), None], And it indeed aligns with the color in the Bevy reproducer without MSAA, but when MSAA is turned on in Bevy, you can see the discrepancy (left is bevy with MSAA, right is Vulkano with MSAA, both with 4 samples): I wouldn't call myself a Vulkan expert though, and this was just a quick attempt to reproduce the issue, so I wouldn't rule out any mistakes in my adaption of that triangle example either. |
Bevy version
0.12
Operating system & version
Ubuntu 18.04
What you did
Run the bevy
sprite
exampleWhat you expected to happen
See a nice Bevy icon.
What actually happened
Additional information
I tracked this change down to c2da780 (this commit added MSAA to sprites). Turning off MSAA with
app.insert_resource(Msaa { samples: 1 })
resolves the issue.Part of
vulkaninfo
output:The text was updated successfully, but these errors were encountered: