bevyengine / bevyengine/bevy

MSAA changes camera ordering.

Open
#22,453 2 comments 0 reactions 0 assignees View on GitHub
A-Rendering C-Bug S-Needs-Investigation
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## Bevy version and features

- Bevy 0.17.3
- Bevy `main`

## What you did

```rust
use bevy::prelude::*;

fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_systems(Startup, spawn)
.run();
}

fn spawn(mut commands: Commands) {
commands.spawn((
Camera2d,
Camera {
order: 1,
clear_color: ClearColorConfig::Custom(Color::srgb(0., 1., 0.)), // This colour is visible when Msaa::Off
..default()
},
Msaa::Off,
));
commands.spawn((
Camera2d,
Camera {
order: 0,
clear_color: ClearColorConfig::Custom(Color::srgb(1., 0., 0.)), // This colour is visible when Msaa is default
..default()
},
Msaa::Off,
));
}
```

I cut down the features to just: (not necessarily the minimal set)
```toml
"std",
"async_executor",
"bevy_asset",
"bevy_core_pipeline",
"bevy_post_process",
"bevy_anti_alias",
"bevy_log",
"bevy_pbr",
"bevy_render",
"bevy_image",
"bevy_camera",
"bevy_shader",
"bevy_window",
"bevy_winit",
"custom_cursor",
"default_font",
"hdr",
"png",
"reflect_auto_register",
"smaa_luts",
"sysinfo_plugin",
"tonemapping_luts",
"x11",
"debug",
"zstd_rust",
```

## What went wrong

For some reason, one colour is displayed for (about, didn't measure exactly) one frame, before switching to the other colour. More mysteriously, whether MSAA is on or off determines which colour it is, which means that MSAA changes camera ordering, despite it being explicitly determined.

Also note that if only one camera has the component, the window freezes before presenting the first frame. (With the freeze caused by a wgpu validation failed error.)

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.