-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
fix some post-processing issues #7474
Conversation
Sure, this is what I've been testing it with: use bevy::{core_pipeline::clear_color::ClearColorConfig, prelude::*, render::view::RenderLayers};
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_startup_system(startup)
.run();
}
fn startup(mut commands: Commands, asset_server: Res<AssetServer>) {
commands.spawn(Camera2dBundle {
camera_2d: Camera2d {
clear_color: ClearColorConfig::Custom(Color::WHITE),
},
..Default::default()
});
commands.spawn((
UiCameraConfig { show_ui: false },
Camera2dBundle {
camera_2d: Camera2d {
clear_color: ClearColorConfig::None,
},
camera: Camera {
order: 1,
..Default::default()
},
..Default::default()
},
RenderLayers::layer(1),
));
commands.spawn(NodeBundle {
style: Style {
size: Size::new(Val::Percent(100.0), Val::Percent(50.0)),
..Default::default()
},
background_color: BackgroundColor(Color::rgba(1.0, 0.0, 0.0, 0.8)),
..Default::default()
});
commands.spawn((
SpriteBundle {
texture: asset_server.load("branding/icon.png"),
..Default::default()
},
RenderLayers::layer(1),
));
} The Node should fill up the top half of the window and be behind the Sprite, but the bug causes it to not be visible at all unless the top layer has show_ui enabled. |
if you change the second camera's clear color to i mentioned that in the migration guide, but i think if we decide this is the right approach it might be worth changing the behaviour of |
Ah, you're right. That does fix it. Sorry I missed that in the migration guide. I do agree about maybe changing the behavior of |
closing too for #7490 |
Objective
fix some post-processing issues
Solution
Some(BlendState::ALPHA_BLENDING)
when writing each camera's result to the output texture instead of just overwritingtodo:
CameraBlendMode(Option<Wgpu::BlendState>)
component to allow controlling the blend modefix #7435
fix #7361
hopefully fix #5721 (again i haven't tested that)
Migration Guide
ClearColor::None
on secondary cameras, you will now probably wantClearColorConfig::Custom(Color::NONE)
, which will clear the texture to transparent