diff --git a/shaders/compiled/rt_compute.spv b/shaders/compiled/rt_compute.spv index 77f16d8..39f83f3 100644 Binary files a/shaders/compiled/rt_compute.spv and b/shaders/compiled/rt_compute.spv differ diff --git a/shaders/rt_compute.comp b/shaders/rt_compute.comp index e51587a..7ec8245 100644 --- a/shaders/rt_compute.comp +++ b/shaders/rt_compute.comp @@ -26,7 +26,7 @@ layout(binding = 6) buffer Indices { uint indices[]; }; -layout (local_size_x = 256, local_size_y = 1, local_size_z = 1) in; +layout (local_size_x = 16, local_size_y = 1, local_size_z = 1) in; uvec4 unpack_color(uint val) { // left most 8 bits first @@ -241,14 +241,9 @@ void main() { } if (render) { - add_cube(index * compound_grid_size + z, compound_scale, check_pos, color); + add_cube(gl_GlobalInvocationID.x * compound_grid_size + z, compound_scale, check_pos, color); } - - } - //add_cube(0, compound_scale, compound_pos + mid_offset, vec3(1.0, 0.0, 0.0)); - //add_cube(1, compound_scale, compound_pos + vec3(float(compound_grid_size) * compound_scale, float(compound_grid_size) * compound_scale, float(compound_grid_size) * compound_scale) + mid_offset, vec3(1.0, 0.0, 0.0)); - - volumes[index] = compounds[index]; + //volumes[index] = compounds[index]; } \ No newline at end of file diff --git a/src/command_buffer.rs b/src/command_buffer.rs index 00159eb..583f1e9 100644 --- a/src/command_buffer.rs +++ b/src/command_buffer.rs @@ -70,7 +70,7 @@ pub unsafe fn create_command_buffers(device: &Device, data: &mut app_data::AppDa &[data.descriptor_sets[i]], &[]); - device.cmd_dispatch(*command_buffer, (data.compute_task_one_size as f64 / 256.0).ceil() as u32, 1, 1); + device.cmd_dispatch(*command_buffer, (data.compute_task_one_size as f64 / 16.0).ceil() as u32, 1, 1); let buffer_memory_barrier_vertex = vk::BufferMemoryBarrier::builder() .buffer(data.compute_out_cuboid_buffers[i]) diff --git a/src/scene/generators.rs b/src/scene/generators.rs index 8e185e5..32f107e 100644 --- a/src/scene/generators.rs +++ b/src/scene/generators.rs @@ -124,6 +124,12 @@ pub fn generate_test_scene(scene: &mut Scene, data: &mut AppData) -> Result<(Poi comp.excluded_shapes.push(Rc::new(RefCell::new(Sphere::new(Vector3 { x: 5.0 + grid_size as f32, y: 5.0 + grid_size as f32, z: 11.5 }, Vector3 { x: 0.0, y: 0.0, z: 0.0 }, 1.5, Vector3 { x: 0, y: 255, z: 0 }, 64, false)))); scene.volumetrics.push(Rc::new(RefCell::new(comp))); + let mut comp = ShapeComposition::new(64); + comp.included_shapes.push(Rc::new(RefCell::new(Sphere::new(Vector3 { x: 20.0 + grid_size as f32, y: 5.0 + grid_size as f32, z: 10.0 }, Vector3 { x: 0.0, y: 0.0, z: 0.0 }, 2.0, Vector3 { x: 0, y: 255, z: 0 }, 64, false)))); + comp.included_shapes.push(Rc::new(RefCell::new(Sphere::new(Vector3 { x: 20.0 + grid_size as f32, y: 5.0 + grid_size as f32, z: 10.0 }, Vector3 { x: 0.0, y: 0.0, z: 0.0 }, 2.5, Vector3 { x: 255, y: 0, z: 0 }, 64, false)))); + comp.excluded_shapes.push(Rc::new(RefCell::new(Sphere::new(Vector3 { x: 20.0 + grid_size as f32, y: 5.0 + grid_size as f32, z: 11.5 }, Vector3 { x: 0.0, y: 0.0, z: 0.0 }, 1.5, Vector3 { x: 0, y: 255, z: 0 }, 64, false)))); + scene.volumetrics.push(Rc::new(RefCell::new(comp))); + Ok((cgmath::point3(5.0, 5.0, 10.0))) }