aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
authorladevieq <ladevie.quentin@gmail.com>2021-03-10 22:37:36 +0100
committerladevieq <ladevie.quentin@gmail.com>2021-03-10 22:37:36 +0100
commit66936e950029869d84b26d9224674c9060e1d96f (patch)
tree398eb837806a0f45d908ae11f2d61ee7a2958bc9 /src/main.cpp
parent214c32a5475ec302b0caa837ea4d241ece263174 (diff)
Add naive tonemapping
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp
index fd582a5..0ca6a0a 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -47,11 +47,12 @@ int main() {
const float aspect_ratio = 16.0 / 9.0;
uint32_t width = 400;
uint32_t height = width / aspect_ratio;
- const uint32_t samples_per_pixel = 25;
+ const uint32_t samples_per_pixel = 100;
window wnd { width , height };
float delta_time = 0.f;
+ uint64_t frame_count = 0;
auto start = std::chrono::high_resolution_clock::now();
auto end = std::chrono::high_resolution_clock::now();
auto inputs = create_inputs(width, height, samples_per_pixel);
@@ -181,7 +182,7 @@ int main() {
renderer.compute(width, height);
- ((input_data*) renderer.compute_shader_buffer.alloc_info.pMappedData)->sample_index++;
+ ((input_data*) renderer.compute_shader_buffer.alloc_info.pMappedData)->sample_index = frame_count % 1000;
renderer.ui();
@@ -190,6 +191,8 @@ int main() {
// stop the capture
// if(rdoc_api) rdoc_api->EndFrameCapture(NULL, NULL);
+
+ frame_count++;
}
//-------------------------