refactoring
This commit is contained in:
parent
3729237e0e
commit
dab82367f0
2 changed files with 9 additions and 11 deletions
|
@ -41,15 +41,6 @@ impl LightUniform {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[repr(C)]
|
|
||||||
#[derive(Debug, Default, Copy, Clone, bytemuck::Pod, bytemuck::Zeroable)]
|
|
||||||
pub struct GlobalUniforms {
|
|
||||||
pub light_matrix_index: u32,
|
|
||||||
// No DownlevelFlags::BUFFER_BINDINGS_NOT_16_BYTE_ALIGNED in WebGL
|
|
||||||
pub use_shadowmaps: u32,
|
|
||||||
_padding: [u32; 2],
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait DrawLight<'a> {
|
pub trait DrawLight<'a> {
|
||||||
fn draw_light_mesh(
|
fn draw_light_mesh(
|
||||||
&mut self,
|
&mut self,
|
||||||
|
|
|
@ -6,8 +6,6 @@ use std::time::Duration;
|
||||||
|
|
||||||
use wgpu::util::DeviceExt;
|
use wgpu::util::DeviceExt;
|
||||||
use winit::{event::*, window::Window};
|
use winit::{event::*, window::Window};
|
||||||
use winit::dpi::PhysicalSize;
|
|
||||||
use crate::core::light::GlobalUniforms;
|
|
||||||
|
|
||||||
use super::camera::{Camera, CameraController, CameraUniform};
|
use super::camera::{Camera, CameraController, CameraUniform};
|
||||||
use super::instance::{Instance, InstanceRaw};
|
use super::instance::{Instance, InstanceRaw};
|
||||||
|
@ -20,6 +18,15 @@ use super::texture::Texture;
|
||||||
const SHADOW_MAP_SIZE: u32 = 1024;
|
const SHADOW_MAP_SIZE: u32 = 1024;
|
||||||
const SHADOW_MAP_LAYERS: u32 = 6;
|
const SHADOW_MAP_LAYERS: u32 = 6;
|
||||||
|
|
||||||
|
#[repr(C)]
|
||||||
|
#[derive(Debug, Default, Copy, Clone, bytemuck::Pod, bytemuck::Zeroable)]
|
||||||
|
pub struct GlobalUniforms {
|
||||||
|
pub light_matrix_index: u32,
|
||||||
|
// No DownlevelFlags::BUFFER_BINDINGS_NOT_16_BYTE_ALIGNED in WebGL
|
||||||
|
pub use_shadowmaps: u32,
|
||||||
|
_padding: [u32; 2],
|
||||||
|
}
|
||||||
|
|
||||||
pub struct State {
|
pub struct State {
|
||||||
pub size: winit::dpi::PhysicalSize<u32>,
|
pub size: winit::dpi::PhysicalSize<u32>,
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue