Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion crates/client/src/pixel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"))]
Expand Down Expand Up @@ -196,7 +200,7 @@ fn follow(
windows: Query<&Window, With<PrimaryWindow>>,
mut cameras: Query<
(Entity, &Camera, &mut RenderTarget, &mut Projection, Has<OnWindow>),
Without<Present>,
(Without<Present>, Without<OwnTarget>),
>,
presenting: Query<Entity, (With<Present>, With<Camera>)>,
present: Query<Entity, With<Present>>,
Expand Down
2 changes: 2 additions & 0 deletions crates/client/src/track_picture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -351,6 +352,7 @@ fn capture_target(images: &mut Assets<Image>) -> Handle<Image> {
fn camera(order: isize, clear_color: ClearColorConfig, target: &Handle<Image>) -> impl Bundle {
(
OverlayCamera,
OwnTarget,
Camera3d::default(),
Camera {
order,
Expand Down
Loading