volume creation improvement 1

This commit is contained in:
zomseffen 2025-01-22 10:10:47 +01:00
parent 9b618b0e3f
commit 886f92470c
4 changed files with 402 additions and 306 deletions
src/scene

View file

@ -72,7 +72,8 @@ impl Scene {
let cube = Cube {
pos: vec3(x_index as f32, y_index as f32, 5.0),
color: vec3(shade, 1.0, shade),
tex_coord: vec2(0.0, 0.0)
tex_coord: vec2(0.0, 0.0),
transparent: false,
};
oct_tree.set_cube(cube.clone());
@ -83,7 +84,8 @@ impl Scene {
let cube = Cube {
pos: vec3(10.0, 10.0, 10.0),
color: vec3(1.0, 1.0, 0.0),
tex_coord: vec2(0.0, 0.0)
tex_coord: vec2(0.0, 0.0),
transparent: true,
};
oct_tree.set_cube(cube.clone());
@ -167,7 +169,7 @@ impl Scene {
for light in &self.point_lights {
volume_vec = light.insert_into_memory(volume_vec);
}
println!("volume_vec print {:?}", volume_vec);
//println!("volume_vec print {:?}", volume_vec);
self.rt_memory = volume_vec;
data.scene_rt_memory_size = (self.rt_memory.len() * 4) as u64; // size of the needed buffer size in bytes