diff options
Diffstat (limited to 'apps')
| -rw-r--r-- | apps/fparkan-game/src/designer_model.rs | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/apps/fparkan-game/src/designer_model.rs b/apps/fparkan-game/src/designer_model.rs index 9bf24600..3070a688 100644 --- a/apps/fparkan-game/src/designer_model.rs +++ b/apps/fparkan-game/src/designer_model.rs @@ -3,12 +3,14 @@ use super::{ VulkanSmokeRenderer, VulkanStaticCamera, }; use fparkan_assets::designer_screen::MODEL_VIEWPORT; -use fparkan_render_vulkan::VulkanModelPreview; +use fparkan_render::designer_lighting::{light_directions, ELEVATION, LIGHT_RGB}; +use fparkan_render_vulkan::{ + VulkanDirectionalLight, VulkanModelPreview, VULKAN_DIRECTIONAL_LIGHT_COUNT, +}; use fparkan_runtime::{factory_project_root, factory_project_schemes, Engine}; use std::ops::Range; const SPIN_RADIANS_PER_MS: f32 = f32::from_bits(0x3a449ba6); -const ELEVATION: f32 = 0.5; const HALF_FOV: f32 = std::f32::consts::FRAC_PI_6; pub(super) struct DesignerModels(Vec<Option<DesignerModel>>); @@ -196,12 +198,22 @@ impl DesignerModel { aspect, ), }; + let mut lights = [VulkanDirectionalLight::default(); VULKAN_DIRECTIONAL_LIGHT_COUNT]; + for (light, direction) in lights.iter_mut().zip(light_directions(yaw)) { + *light = VulkanDirectionalLight { + direction, + rgb: LIGHT_RGB, + active: true, + ..VulkanDirectionalLight::default() + }; + } VulkanModelPreview { ranges: self.draws.clone(), draw_before: None, viewport, camera, eye, + lights, } } } |
