diff options
| author | ladevieq <ladevie.quentin@gmail.com> | 2021-05-23 23:04:45 +0200 |
|---|---|---|
| committer | ladevieq <ladevie.quentin@gmail.com> | 2021-05-23 23:04:45 +0200 |
| commit | 5d04af401d5466c7908a001c70009cb4da285abd (patch) | |
| tree | 89b7afff9bd9c37eb0f42fe9476b5b704b34eb65 /src | |
| parent | 2c07c0b7df2b13cd5deea8233e1c4eb61a85a766 (diff) | |
Add dof toggler & attempt to use bvh
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.cpp | 4 | ||||
| -rw-r--r-- | src/utils.cpp | 3 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp index f8699af..68dd0ee 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -199,6 +199,10 @@ int main() { ImGui::Text("frame time %f ms\n", delta_time); ImGui::Text("frame count %u\n", ((input_data*) renderer.compute_shader_buffer.alloc_info.pMappedData)->sample_index); + if (ImGui::Checkbox("depth of field", (bool*)&((input_data*) renderer.compute_shader_buffer.alloc_info.pMappedData)->enable_dof)) { + reset_accumulation = true; + } + ImGui::SliderInt("bounces", (int32_t*)&((input_data*) renderer.compute_shader_buffer.alloc_info.pMappedData)->max_bounce, 2, 250); if (ImGui::Checkbox("debug bvh", (bool*)&((input_data*) renderer.compute_shader_buffer.alloc_info.pMappedData)->debug_bvh)) { diff --git a/src/utils.cpp b/src/utils.cpp index bbf8ea4..6db101c 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -141,6 +141,7 @@ struct input_data create_inputs(uint32_t width, uint32_t height) { .height = height, .sample_index = 0, + .enable_dof = true, .debug_bvh = false, }; @@ -151,7 +152,7 @@ struct input_data create_inputs(uint32_t width, uint32_t height) { bvh builder; builder.build(inputs.spheres, spheres_count); - builder.exporter(); + // builder.exporter(); for (uint32_t idx = 0; idx < builder.nodes.size(); idx++) { inputs.nodes[idx] = builder.nodes[idx]; |
