diff --git a/crates/bevy_render/src/camera/camera.rs b/crates/bevy_render/src/camera/camera.rs index 7a3defd68c879..51f459273bad5 100644 --- a/crates/bevy_render/src/camera/camera.rs +++ b/crates/bevy_render/src/camera/camera.rs @@ -823,6 +823,7 @@ pub struct ExtractedCamera { pub clear_color: ClearColorConfig, pub sorted_camera_index_for_target: usize, pub exposure: f32, + pub hdr: bool, } pub fn extract_cameras( @@ -902,6 +903,7 @@ pub fn extract_cameras( exposure: exposure .map(|e| e.exposure()) .unwrap_or_else(|| Exposure::default().exposure()), + hdr: camera.hdr, }, ExtractedView { projection: camera.projection_matrix(), @@ -953,6 +955,7 @@ pub struct SortedCamera { pub entity: Entity, pub order: isize, pub target: Option, + pub hdr: bool, } pub fn sort_cameras( @@ -965,6 +968,7 @@ pub fn sort_cameras( entity, order: camera.order, target: camera.target.clone(), + hdr: camera.hdr, }); } // sort by order and ensure within an order, RenderTargets of the same type are packed together @@ -985,7 +989,7 @@ pub fn sort_cameras( } } if let Some(target) = &sorted_camera.target { - let count = target_counts.entry(target.clone()).or_insert(0usize); + let count = target_counts.entry((target.clone(), sorted_camera.hdr)).or_insert(0usize); let (_, mut camera) = cameras.get_mut(sorted_camera.entity).unwrap(); camera.sorted_camera_index_for_target = *count; *count += 1;