diff --git a/voxygen/src/menu/dummy_scene.rs b/voxygen/src/menu/dummy_scene.rs index e3742de385..48cd27e17e 100644 --- a/voxygen/src/menu/dummy_scene.rs +++ b/voxygen/src/menu/dummy_scene.rs @@ -11,12 +11,14 @@ impl Scene { pub fn new(renderer: &mut Renderer) -> Self { let global_data = GlobalModel { globals: renderer.create_consts(&[Globals::default()]), - lights: renderer.create_consts(&[Light::default(); 20]), - shadows: renderer.create_consts(&[Shadow::default(); 32]), + lights: renderer.create_consts(&[Light::default(); crate::scene::MAX_LIGHT_COUNT]), + shadows: renderer.create_consts(&[Shadow::default(); crate::scene::MAX_SHADOW_COUNT]), shadow_mats: renderer.create_shadow_bound_locals(&[ShadowLocals::default()]), rain_occlusion_mats: renderer .create_rain_occlusion_bound_locals(&[RainOcclusionLocals::default()]), - point_light_matrices: Box::new([PointLightMatrix::default(); 126]), + point_light_matrices: Box::new( + [PointLightMatrix::default(); crate::scene::MAX_POINT_LIGHT_MATRICES_COUNT], + ), }; let lod_data = LodData::dummy(renderer); diff --git a/voxygen/src/scene/mod.rs b/voxygen/src/scene/mod.rs index a813459769..0b9aa85653 100644 --- a/voxygen/src/scene/mod.rs +++ b/voxygen/src/scene/mod.rs @@ -53,8 +53,9 @@ const ZOOM_CAP_ADMIN: f32 = 100000.0; // TODO: Don't hard-code this. const CURSOR_PAN_SCALE: f32 = 0.005; -const MAX_LIGHT_COUNT: usize = 20; // 31 (total shadow_mats is limited to 128 with default max_uniform_buffer_binding_size) -const MAX_SHADOW_COUNT: usize = 24; +pub(crate) const MAX_LIGHT_COUNT: usize = 20; // 31 (total shadow_mats is limited to 128 with default max_uniform_buffer_binding_size) +pub(crate) const MAX_SHADOW_COUNT: usize = 24; +pub(crate) const MAX_POINT_LIGHT_MATRICES_COUNT: usize = MAX_LIGHT_COUNT * 6 + 6; const NUM_DIRECTED_LIGHTS: usize = 1; const LIGHT_DIST_RADIUS: f32 = 64.0; // The distance beyond which lights may not emit light from their origin const SHADOW_DIST_RADIUS: f32 = 8.0; @@ -304,7 +305,9 @@ impl Scene { shadow_mats: renderer.create_shadow_bound_locals(&[ShadowLocals::default()]), rain_occlusion_mats: renderer .create_rain_occlusion_bound_locals(&[RainOcclusionLocals::default()]), - point_light_matrices: Box::new([PointLightMatrix::default(); MAX_LIGHT_COUNT * 6 + 6]), + point_light_matrices: Box::new( + [PointLightMatrix::default(); MAX_POINT_LIGHT_MATRICES_COUNT], + ), }; let lod = Lod::new(renderer, client, settings);