From a7707f730cd28853dc750b72ec882f07dba85406 Mon Sep 17 00:00:00 2001 From: ladevieq Date: Wed, 12 May 2021 23:39:42 +0200 Subject: Add light sources, use russian roulette for opti and infinite accumulation --- include/material.hpp | 2 ++ include/utils.hpp | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/material.hpp b/include/material.hpp index 10886da..ee4281b 100644 --- a/include/material.hpp +++ b/include/material.hpp @@ -7,10 +7,12 @@ enum MATERIAL_TYPE: uint32_t { LAMBERTIAN = 0, METAL = 1, DIELECTRIC = 2, + EMISSIVE = 3, }; struct material { color albedo; + color emissive; float fuzz; float ior; uint32_t type; diff --git a/include/utils.hpp b/include/utils.hpp index 11d377a..a95c95d 100644 --- a/include/utils.hpp +++ b/include/utils.hpp @@ -20,19 +20,21 @@ struct input_data { bvh_node nodes[1024]; uint32_t max_bounce; - uint32_t samples_per_pixel; // Output image resolution uint32_t width; uint32_t height; uint32_t sample_index; + + uint32_t spheres_count; + uint32_t padding[3]; }; std::vector get_shader_code(const char* path); std::vector get_shader_code(std::string& path); -struct input_data create_inputs(uint32_t width, uint32_t height, uint32_t samples_per_pixel); +struct input_data create_inputs(uint32_t width, uint32_t height); #define PI 3.14159265359 -- cgit v1.3