From 558f9a40d2c1d82c808477b76fab71a8e55f1121 Mon Sep 17 00:00:00 2001 From: ladevieq Date: Mon, 4 Jan 2021 00:26:10 +0100 Subject: Fix artifacts and add gamma correction --- src/main.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/main.cpp b/src/main.cpp index a10ff7e..885b078 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -81,9 +81,9 @@ int main() { vkrenderer renderer {}; // Image dimensions - // const float aspect_ratio = 16.0 / 9.0; - const float aspect_ratio = 1.0; - const size_t width = 400; + const float aspect_ratio = 16.0 / 9.0; + // const float aspect_ratio = 1.0; + const size_t width = 1920; const size_t height = width / aspect_ratio; const uint32_t samples_per_pixel = 100; const uint32_t max_depth = 100; @@ -106,13 +106,17 @@ int main() { { { 0.f, 0.f, -1.f }, { { 0.f, 0.f, 1.f }, }, 0.5f }, { { 0.f, -100.5f, -1.f }, { { 0.f, 1.f, 0.f }, }, 100.f } }, - .max_bounce = 50, + .max_bounce = max_depth, }; for (size_t rand_number_index = 0; rand_number_index < samples_per_pixel * 2; rand_number_index++) { inputs.random_numbers[rand_number_index] = randd(); } + for (size_t rand_number_index = 0; rand_number_index < max_depth * 10; rand_number_index++) { + inputs.random_in_sphere[rand_number_index] = random_in_unit_sphere(); + } + // World hittable objects hittable_list world = random_scene(); -- cgit v1.3