@@ -21,7 +21,7 @@ use bevy_camera::{
2121 visibility:: { self , RenderLayers , VisibleEntities } ,
2222 Camera , Camera2d , Camera3d , CameraMainTextureUsages , CameraOutputMode , CameraUpdateSystems ,
2323 ClearColor , ClearColorConfig , Exposure , ManualTextureViewHandle , MsaaWriteback ,
24- NormalizedRenderTarget , Projection , RenderTargetInfo , Viewport ,
24+ NormalizedRenderTarget , Projection , RenderTarget , RenderTargetInfo , Viewport ,
2525} ;
2626use bevy_derive:: { Deref , DerefMut } ;
2727use bevy_ecs:: {
@@ -312,7 +312,7 @@ pub fn camera_system(
312312 windows : Query < ( Entity , & Window ) > ,
313313 images : Res < Assets < Image > > ,
314314 manual_texture_views : Res < ManualTextureViews > ,
315- mut cameras : Query < ( & mut Camera , & mut Projection ) > ,
315+ mut cameras : Query < ( & mut Camera , & RenderTarget , & mut Projection ) > ,
316316) -> Result < ( ) , BevyError > {
317317 let primary_window = primary_window. iter ( ) . next ( ) ;
318318
@@ -333,13 +333,13 @@ pub fn camera_system(
333333 } )
334334 . collect ( ) ;
335335
336- for ( mut camera, mut camera_projection) in & mut cameras {
336+ for ( mut camera, render_target , mut camera_projection) in & mut cameras {
337337 let mut viewport_size = camera
338338 . viewport
339339 . as_ref ( )
340340 . map ( |viewport| viewport. physical_size ) ;
341341
342- if let Some ( normalized_target) = & camera . target . normalize ( primary_window)
342+ if let Some ( normalized_target) = render_target . normalize ( primary_window)
343343 && ( normalized_target. is_changed ( & changed_window_ids, & changed_image_handles)
344344 || camera. is_added ( )
345345 || camera_projection. is_changed ( )
@@ -423,18 +423,21 @@ pub fn extract_cameras(
423423 Entity ,
424424 RenderEntity ,
425425 & Camera ,
426+ & RenderTarget ,
426427 & CameraRenderGraph ,
427428 & GlobalTransform ,
428429 & VisibleEntities ,
429430 & Frustum ,
430- Has < Hdr > ,
431- Option < & ColorGrading > ,
432- Option < & Exposure > ,
433- Option < & TemporalJitter > ,
434- Option < & MipBias > ,
435- Option < & RenderLayers > ,
436- Option < & Projection > ,
437- Has < NoIndirectDrawing > ,
431+ (
432+ Has < Hdr > ,
433+ Option < & ColorGrading > ,
434+ Option < & Exposure > ,
435+ Option < & TemporalJitter > ,
436+ Option < & MipBias > ,
437+ Option < & RenderLayers > ,
438+ Option < & Projection > ,
439+ Has < NoIndirectDrawing > ,
440+ ) ,
438441 ) > ,
439442 > ,
440443 primary_window : Extract < Query < Entity , With < PrimaryWindow > > > ,
@@ -457,18 +460,21 @@ pub fn extract_cameras(
457460 main_entity,
458461 render_entity,
459462 camera,
463+ render_target,
460464 camera_render_graph,
461465 transform,
462466 visible_entities,
463467 frustum,
464- hdr,
465- color_grading,
466- exposure,
467- temporal_jitter,
468- mip_bias,
469- render_layers,
470- projection,
471- no_indirect_drawing,
468+ (
469+ hdr,
470+ color_grading,
471+ exposure,
472+ temporal_jitter,
473+ mip_bias,
474+ render_layers,
475+ projection,
476+ no_indirect_drawing,
477+ ) ,
472478 ) in query. iter ( )
473479 {
474480 if !camera. is_active {
@@ -523,7 +529,7 @@ pub fn extract_cameras(
523529 let mut commands = commands. entity ( render_entity) ;
524530 commands. insert ( (
525531 ExtractedCamera {
526- target : camera . target . normalize ( primary_window) ,
532+ target : render_target . normalize ( primary_window) ,
527533 viewport : camera. viewport . clone ( ) ,
528534 physical_viewport_size : Some ( viewport_size) ,
529535 physical_target_size : Some ( target_size) ,
0 commit comments