Skip to content

Commit

Permalink
Split screen foxes work
Browse files Browse the repository at this point in the history
Signed-off-by: Torstein Grindvik <torstein.grindvik@nordicsemi.no>
  • Loading branch information
torsteingrindvik committed Jan 12, 2023
1 parent 67b268e commit 323e1e4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 5 additions & 1 deletion crates/bevy_core_pipeline/src/core_3d/main_pass_3d_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,11 @@ impl Node for MainPass3dNode {

if let Some(picking_textures) = picking_textures {
color_attachments.push(Some(picking_textures.get_color_attachment(Operations {
load: LoadOp::Clear(PickingTextures::clear_color()),
// If the wish is to not clear the screen, don't clear the picking buffer either.
load: match camera_3d.clear_color {
ClearColorConfig::None => LoadOp::Load,
_ => LoadOp::Clear(PickingTextures::clear_color()),
},
store: true,
})));
}
Expand Down
4 changes: 3 additions & 1 deletion examples/3d/split_screen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::f32::consts::PI;
use bevy::{
core_pipeline::clear_color::ClearColorConfig,
prelude::*,
render::camera::Viewport,
render::{camera::Viewport, picking::Picking},
window::{WindowId, WindowResized},
};

Expand Down Expand Up @@ -53,6 +53,7 @@ fn setup(
..default()
},
LeftCamera,
Picking::default(),
));

// Right Camera
Expand All @@ -72,6 +73,7 @@ fn setup(
..default()
},
RightCamera,
Picking::default(),
));
}

Expand Down
2 changes: 1 addition & 1 deletion examples/app/picking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use bevy::{
fn main() {
App::new()
// TODO: Support MSAA != 1 with depth texture copies
.insert_resource(Msaa { samples: 1 })
// .insert_resource(Msaa { samples: 1 })
.add_plugins(DefaultPlugins)
.init_resource::<MousePosition>()
.init_resource::<Hovered>()
Expand Down

0 comments on commit 323e1e4

Please sign in to comment.