diff --git a/crates/client/src/pixel.rs b/crates/client/src/pixel.rs index 6f85380..1cf67cb 100644 --- a/crates/client/src/pixel.rs +++ b/crates/client/src/pixel.rs @@ -67,6 +67,10 @@ pub struct Present; #[derive(Component)] pub struct OnWindow; +/// A camera that draws into an image of its own, which is left as it is: a picture of a track's. +#[derive(Component)] +pub struct OwnTarget; + /// The order of the camera that puts the picture on the window: after the scene's cameras, which /// draw into the picture, and before the HUD's ([`OnWindow`]), which draw over it. #[cfg(not(target_arch = "wasm32"))] @@ -196,7 +200,7 @@ fn follow( windows: Query<&Window, With>, mut cameras: Query< (Entity, &Camera, &mut RenderTarget, &mut Projection, Has), - Without, + (Without, Without), >, presenting: Query, With)>, present: Query>, diff --git a/crates/client/src/track_picture.rs b/crates/client/src/track_picture.rs index 4a3e6db..240819d 100644 --- a/crates/client/src/track_picture.rs +++ b/crates/client/src/track_picture.rs @@ -32,6 +32,7 @@ use crate::drive::{ChaseCamera, Kart}; use crate::kart::KartSlot; use crate::hud::atlas_image; use crate::loading::Loading; +use crate::pixel::OwnTarget; use crate::lobby::Lobby; use crate::scene::{spawn_layers, spawn_parts}; use crate::shadow::Shadow; @@ -351,6 +352,7 @@ fn capture_target(images: &mut Assets) -> Handle { fn camera(order: isize, clear_color: ClearColorConfig, target: &Handle) -> impl Bundle { ( OverlayCamera, + OwnTarget, Camera3d::default(), Camera { order,