This commit is contained in:
2021-01-26 18:12:12 -08:00
parent 77dcf1faf9
commit 9ebaece426
8 changed files with 12492 additions and 30 deletions

View File

@@ -1,7 +1,8 @@
use bytemuck::__core::ops::Range;
use bytemuck::{Zeroable, Pod};
use crate::OPENGL_TO_WGPU_MATRIX;
struct Light {
pub struct Light {
pos: cgmath::Point3<f32>,
color: wgpu::Color,
fov: f32,
@@ -11,7 +12,7 @@ struct Light {
#[repr(C)]
#[derive(Clone, Copy)]
struct LightRaw {
pub struct LightRaw {
proj: [[f32; 4]; 4],
pos: [f32; 4],
color: [f32; 4],
@@ -32,7 +33,7 @@ impl Light {
near: self.depth.start,
far: self.depth.end,
};
let mx_correction = framework::OPENGL_TO_WGPU_MATRIX;
let mx_correction = OPENGL_TO_WGPU_MATRIX;
let mx_view_proj =
mx_correction * cgmath::Matrix4::from(projection.to_perspective()) * mx_view;
LightRaw {