diff --git a/rmf_site_editor/src/interaction/camera_controls/mod.rs b/rmf_site_editor/src/interaction/camera_controls/mod.rs index 3ab882ba..0d3c2f0c 100644 --- a/rmf_site_editor/src/interaction/camera_controls/mod.rs +++ b/rmf_site_editor/src/interaction/camera_controls/mod.rs @@ -61,14 +61,14 @@ pub const MODEL_PREVIEW_LAYER: u8 = 6; // Creates all the layers visible in the main camera view (excluding, for example // the model preview which is on a separate view). The main lights will affect these. -fn main_view_render_layers() -> RenderLayers { +pub fn main_view_render_layers() -> RenderLayers { RenderLayers::from_layers(&[ GENERAL_RENDER_LAYER, PHYSICAL_RENDER_LAYER, VISUAL_CUE_RENDER_LAYER, SELECTED_OUTLINE_LAYER, HOVERED_OUTLINE_LAYER, - XRAY_RENDER_LAYER + XRAY_RENDER_LAYER, ]) } @@ -407,8 +407,9 @@ impl FromWorld for CameraControls { .push_children(&orthographic_child_cameras) .id(); - let mut ambient_light = world.get_resource_mut::().expect( - "Make sure bevy's PbrPlugin is initialized before the cameras"); + let mut ambient_light = world + .get_resource_mut::() + .expect("Make sure bevy's PbrPlugin is initialized before the cameras"); ambient_light.brightness = 2.0; diff --git a/rmf_site_editor/src/interaction/model_preview.rs b/rmf_site_editor/src/interaction/model_preview.rs index c985801e..a6bb9566 100644 --- a/rmf_site_editor/src/interaction/model_preview.rs +++ b/rmf_site_editor/src/interaction/model_preview.rs @@ -23,7 +23,10 @@ use bevy::{ core_pipeline::tonemapping::Tonemapping, ecs::system::SystemState, prelude::*, - render::{camera::{Exposure, RenderTarget}, view::RenderLayers}, + render::{ + camera::{Exposure, RenderTarget}, + view::RenderLayers, + }, }; use bevy_egui::{egui::TextureId, EguiContexts}; @@ -75,7 +78,9 @@ impl FromWorld for ModelPreviewCamera { ..default() }, tonemapping: Tonemapping::ReinhardLuminance, - exposure: Exposure { ev100: DEFAULT_CAMERA_EV100 }, + exposure: Exposure { + ev100: DEFAULT_CAMERA_EV100, + }, ..default() }) .insert(RenderLayers::from_layers(&[MODEL_PREVIEW_LAYER])) diff --git a/rmf_site_editor/src/interaction/preview.rs b/rmf_site_editor/src/interaction/preview.rs index d5f5325c..79418104 100644 --- a/rmf_site_editor/src/interaction/preview.rs +++ b/rmf_site_editor/src/interaction/preview.rs @@ -71,7 +71,9 @@ fn create_camera_window( is_active: true, ..default() }) - .insert(Exposure {ev100: DEFAULT_CAMERA_EV100 }) + .insert(Exposure { + ev100: DEFAULT_CAMERA_EV100, + }) .insert(RenderLayers::layer(0)); window_id } diff --git a/rmf_site_editor/src/site/light.rs b/rmf_site_editor/src/site/light.rs index 8502931a..599ebd7e 100644 --- a/rmf_site_editor/src/site/light.rs +++ b/rmf_site_editor/src/site/light.rs @@ -15,7 +15,7 @@ * */ -use crate::site::CurrentLevel; +use crate::{interaction::main_view_render_layers, site::CurrentLevel}; use bevy::{ pbr::CubemapVisibleEntities, prelude::{ @@ -24,7 +24,7 @@ use bevy::{ }, render::{ primitives::{CubemapFrusta, Frustum}, - view::{RenderLayers, VisibleEntities}, + view::VisibleEntities, }, }; use rmf_site_format::{Category, Light, LightKind, NameInSite, Pose}; @@ -64,7 +64,7 @@ pub fn add_physical_lights( .insert(VisibleEntities::default()) .insert(CubemapFrusta::default()) .insert(CubemapVisibleEntities::default()) - .insert(RenderLayers::all()) + .insert(main_view_render_layers()) .insert(Category::Light); if parent.is_none() {