adds multilight handling
This commit is contained in:
parent
4c4b8288d5
commit
729fcb8559
4 changed files with 43 additions and 6 deletions
src/scene
|
@ -88,7 +88,8 @@ impl Scene {
|
|||
|
||||
oct_tree.set_cube(cube.clone());
|
||||
|
||||
self.point_lights.push(PointLight { pos: vec3(11.0, 11.0, 11.0), color: vec3(1.0, 1.0, 1.0), memory_start: 0 });
|
||||
self.point_lights.push(PointLight { pos: vec3(11.0, 11.0, 11.0), color: vec3(0.5, 0.5, 0.5), memory_start: 0 });
|
||||
self.point_lights.push(PointLight { pos: vec3(9.0, 9.0, 11.0), color: vec3(0.5, 0.5, 0.5), memory_start: 0 });
|
||||
|
||||
let mut empty_volumes: Vec<Rc<RefCell<EmptyVolume>>>;
|
||||
(empty_volumes, _) = EmptyVolume::from_oct_tree(&oct_tree);
|
||||
|
@ -113,7 +114,7 @@ impl Scene {
|
|||
else {
|
||||
cube.draw(&data.topology, index, self);
|
||||
}*/
|
||||
cube.draw(&data.topology, index, self);
|
||||
//cube.draw(&data.topology, index, self);
|
||||
}
|
||||
None => {}
|
||||
}
|
||||
|
@ -127,6 +128,15 @@ impl Scene {
|
|||
};
|
||||
let index = self.sized_vertices.len();
|
||||
cube.draw(&data.topology, index, self);
|
||||
|
||||
let cube = Cuboid {
|
||||
pos: vec3(9.0, 9.0, 11.0),
|
||||
color: vec3(shade, 1.0, shade),
|
||||
tex_coord: vec2(0.0, 0.0),
|
||||
size: Vector3 {x: 0.5, y: 0.5, z: 0.5}
|
||||
};
|
||||
let index = self.sized_vertices.len();
|
||||
cube.draw(&data.topology, index, self);
|
||||
|
||||
let mut memory_index = 1; // zero should be the location for the overall length (also will be the invalid memory allocation for pointing to a nonexistant neighbor)
|
||||
for light in &mut self.point_lights {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue