star-mc

Parallel estimation of Monte Carlo integrators
git clone git://git.meso-star.fr/star-mc.git
Log | Files | Refs | README | LICENSE

commit 839580a5f4211fc2a6648cf044f9188a25be1dea
parent 03ff2d4d97705fcd2ed3f47123c81ca5ab42c8a7
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Mon, 27 Nov 2017 15:59:05 +0100

Handle the upd of SSP 0.5 in the light path test

Diffstat:
Mcmake/CMakeLists.txt | 2+-
Msrc/test_smc_light_path.c | 9++-------
2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt @@ -41,7 +41,7 @@ option(NO_TEST "Disable the test" OFF) ################################################################################ find_package(RCMake 0.3 REQUIRED) find_package(RSys 0.4 REQUIRED) -find_package(StarSP 0.4 REQUIRED) +find_package(StarSP 0.5 REQUIRED) find_package(Star3D 0.4) find_package(OpenMP) diff --git a/src/test_smc_light_path.c b/src/test_smc_light_path.c @@ -275,8 +275,6 @@ light_path_integrator(void* value, struct ssp_rng* rng, void* data) FOR_EACH(idepth, 0, LIGHT_PATH_DEPTH) { struct s3d_hit hit = S3D_HIT_NULL; - double Nd[3]; - double sample[4]; float cos_theta; float pdf; float pos[3]; @@ -299,12 +297,9 @@ light_path_integrator(void* value, struct ssp_rng* rng, void* data) L += throughput * direct_lighting(ctx->view, pos, N); /* New ray */ - d3_normalize(Nd, d3_set_f3(Nd, N)); - ssp_ran_hemisphere_cos(rng, Nd, sample); - pdf = (float)sample[3]; - cos_theta = (float)d3_dot(Nd, sample); + ssp_ran_hemisphere_cos_float(rng, N, ray_dir, &pdf); + cos_theta = f3_dot(N, ray_dir); f3_set(ray_org, pos); - f3_normalize(ray_dir, f3_set_d3(ray_dir, sample)); ray_range[0] = EPSILON; throughput *= (float)(ALBEDO / PI) / pdf * cos_theta; }