uncommented and fixed the lights, but everything still is mega-dark
This commit is contained in:
27
src/main.rs
27
src/main.rs
@@ -10,7 +10,7 @@ use bytemuck::__core::ops::Range;
|
||||
use cgmath::{Matrix4, Point3};
|
||||
use futures::task::LocalSpawn;
|
||||
use legion::*;
|
||||
use wgpu::{BindGroup, Buffer};
|
||||
use wgpu::{BindGroup, Buffer, TextureView};
|
||||
use wgpu_subscriber;
|
||||
use winit::platform::unix::x11::ffi::Time;
|
||||
use winit::{
|
||||
@@ -119,11 +119,12 @@ pub struct RangeCopy<Idx> {
|
||||
pub end: Idx,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
struct DirectionalLight {
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct DirectionalLight {
|
||||
color: wgpu::Color,
|
||||
fov: f32,
|
||||
depth: RangeCopy<f32>,
|
||||
target_view: Arc<TextureView>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
@@ -219,23 +220,11 @@ fn main() {
|
||||
// This could be used for relationships between entities...???
|
||||
let light_entity: Entity = world.push((
|
||||
cgmath::Point3 {
|
||||
x: -5.0,
|
||||
y: 7.0,
|
||||
z: 10.0,
|
||||
},
|
||||
DirectionalLight {
|
||||
color: wgpu::Color {
|
||||
r: 1.0,
|
||||
g: 0.5,
|
||||
b: 0.5,
|
||||
a: 1.0,
|
||||
},
|
||||
fov: 45.0,
|
||||
depth: RangeCopy {
|
||||
start: 1.0,
|
||||
end: 20.0,
|
||||
},
|
||||
x: -5.0 as f32,
|
||||
y: 7.0 as f32,
|
||||
z: 10.0 as f32,
|
||||
},
|
||||
renderer.create_light(),
|
||||
));
|
||||
|
||||
let mesh_entity: Entity = world.push((
|
||||
|
||||
Reference in New Issue
Block a user