refactor
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user