From 5e39b7485d08345a4eb3686b344840791888d1f9 Mon Sep 17 00:00:00 2001 From: ladevieq Date: Wed, 10 Feb 2021 14:00:37 +0100 Subject: Accumulation working --- src/utils.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/utils.cpp') diff --git a/src/utils.cpp b/src/utils.cpp index 00745dc..a2cf8f9 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -89,11 +89,10 @@ void random_scene(sphere *world) { world[world_sphere_index + 2] = { { 4, 1, 0 }, material3, 1.0 }; } -struct input_data create_inputs(uint32_t width, uint32_t height) { +struct input_data create_inputs(uint32_t width, uint32_t height, uint32_t samples_per_pixel) { // Image dimensions const float aspect_ratio = (float)width / (float) height; - const uint32_t samples_per_pixel = 10; const uint32_t max_depth = 5; const vec3 camera_position{ 13.0, 2.0, 3.0 }; @@ -113,7 +112,9 @@ struct input_data create_inputs(uint32_t width, uint32_t height) { .max_bounce = max_depth, .samples_per_pixel = samples_per_pixel, .width = width, - .height = height + .height = height, + + .sample_index = 0, }; // Random numbers pools -- cgit v1.3