diff options
| author | ladevieq <ladevie.quentin@gmail.com> | 2021-01-04 00:26:10 +0100 |
|---|---|---|
| committer | ladevieq <ladevie.quentin@gmail.com> | 2021-01-04 00:26:10 +0100 |
| commit | 558f9a40d2c1d82c808477b76fab71a8e55f1121 (patch) | |
| tree | ea48e19bb87458619fbceca191848f26902cc819 /src | |
| parent | 08f2f11ce8c3eee1c6548fa69f4d5bd1931bf839 (diff) | |
Fix artifacts and add gamma correction
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
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(); |
