shadows
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
use crate::renderer::camera::Camera;
|
||||
use cgmath::SquareMatrix;
|
||||
use cgmath::{SquareMatrix, Vector3, InnerSpace};
|
||||
use wgpu::util::DeviceExt;
|
||||
|
||||
#[repr(C)]
|
||||
@@ -8,13 +8,19 @@ pub struct UniformValues {
|
||||
view_inv: [[f32; 4]; 4],
|
||||
proj_inv: [[f32; 4]; 4],
|
||||
cam_pos: [f32; 3],
|
||||
padding: f32,
|
||||
sun_dir: [f32; 3],
|
||||
padding2: f32,
|
||||
time: f32
|
||||
}
|
||||
|
||||
impl UniformValues {
|
||||
|
||||
pub fn new() -> Self {
|
||||
Self::default()
|
||||
|
||||
let sun_vec: Vector3<f32> = (1.0, 1.0, 1.0).into();
|
||||
let sun_dir: [f32; 3] = sun_vec.normalize().into();
|
||||
Self { sun_dir, .. Default::default() }
|
||||
}
|
||||
|
||||
pub fn update(&mut self, camera: &Camera, time: f32) {
|
||||
|
||||
Reference in New Issue
Block a user