Closed tigrazone closed 8 months ago
Hello! Please explain, why pc_ray.radius is not used in shaders but used fixed pc_ray.ppm_base_radius? I see in code, radius is calculated
pc_ray.ppm_base_radius = config->base_radius; const glm::vec3 diam = pc_ray.max_bounds - pc_ray.min_bounds; const float max_comp = glm::max(diam.x, glm::max(diam.y, diam.z)); const int base_grid_res = int(max_comp / pc_ray.radius); pc_ray.grid_res = glm::max(ivec3(diam * float(base_grid_res) / max_comp), ivec3(1)); if (pc_ray.radius < 1e-7f) { pc_ray.radius = 1e-7f; } auto op_reduce = [&](const std::string& op_name, const std::string& op_shader_name, const std::string& reduce_name, const std::string& reduce_shader_name) { uint32_t num_wgs = uint32_t((instance->width * instance->height + 1023) / 1024); instance->vkb.rg->add_compute(op_name, {.shader = Shader(op_shader_name), .dims = {num_wgs, 1, 1}}) .push_constants(&pc_ray) .bind(scene_desc_buffer) .zero({residual_buffer, counter_buffer}); while (num_wgs != 1) { instance->vkb.rg->add_compute(reduce_name, {.shader = Shader(reduce_shader_name), .dims = {num_wgs, 1, 1}}) .push_constants(&pc_ray) .bind(scene_desc_buffer); num_wgs = (uint32_t)(num_wgs + 1023) / 1024; }
code from src/RayTracer/SPPM.cpp lines 78-98. Is possible to use calculated radius as start radius, not fixed ppm_base_radius?
Thanks for pointing out, fixed now.
Hello! Please explain, why pc_ray.radius is not used in shaders but used fixed pc_ray.ppm_base_radius? I see in code, radius is calculated
code from src/RayTracer/SPPM.cpp lines 78-98. Is possible to use calculated radius as start radius, not fixed ppm_base_radius?