adds naive update for light and volumes
This commit is contained in:
parent
90b16a3d5c
commit
579820334d
6 changed files with 158 additions and 52 deletions
src/scene
|
@ -91,9 +91,9 @@ pub fn generate_test_scene(scene: &mut Scene, data: &mut AppData) -> Result<(Poi
|
|||
};
|
||||
oct_tree2.set_cube(cube.clone());
|
||||
|
||||
scene.point_lights.push(Rc::new(RefCell::new(PointLight { pos: vec3(11.0 + grid_size as f32, 11.0 + grid_size as f32, 11.0) * scale, color: vec3(2.0, 2.0, 2.0), memory_start: 0 })));
|
||||
scene.point_lights.push(Rc::new(RefCell::new(PointLight { pos: vec3(9.0 + grid_size as f32, 9.0 + grid_size as f32, 11.0) * scale, color: vec3(0.5, 0.5, 0.5), memory_start: 0 })));
|
||||
scene.directional_lights.push(Rc::new(RefCell::new(DirectionalLight { direction: vec3(1.0, 1.0, -1.0), color: vec3(0.1, 0.1, 0.1), memory_start: 0 })));
|
||||
scene.point_lights.push(Rc::new(RefCell::new(PointLight::init(vec3(11.0 + grid_size as f32, 11.0 + grid_size as f32, 11.0) * scale, vec3(2.0, 2.0, 2.0)))));
|
||||
scene.point_lights.push(Rc::new(RefCell::new(PointLight::init(vec3(9.0 + grid_size as f32, 9.0 + grid_size as f32, 11.0) * scale, vec3(0.5, 0.5, 0.5)))));
|
||||
scene.directional_lights.push(Rc::new(RefCell::new(DirectionalLight::init(vec3(1.0, 1.0, -1.0), vec3(0.1, 0.1, 0.1)))));
|
||||
|
||||
let cube = Cuboid {
|
||||
pos: vec3(11.0 + grid_size as f32, 11.0 + grid_size as f32, 11.0) * scale,
|
||||
|
@ -204,7 +204,7 @@ pub fn generate_test_scene2(scene: &mut Scene, data: &mut AppData, chunk_num_x:
|
|||
let center_x = rng.gen_range(0..max_x) as f32;
|
||||
let center_y = rng.gen_range(0..max_y) as f32;
|
||||
let final_height = height_map[center_x.floor() as usize][center_y.floor() as usize] + height;
|
||||
scene.point_lights.push(Rc::new(RefCell::new(PointLight { pos: vec3(center_x, center_y, final_height), color: vec3(1.0, 1.0, 1.0), memory_start: 0 })));
|
||||
scene.point_lights.push(Rc::new(RefCell::new(PointLight::init(vec3(center_x, center_y, final_height), vec3(1.0, 1.0, 1.0)))));
|
||||
|
||||
let cube = Cuboid {
|
||||
pos: vec3(center_x, center_y, final_height),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue