commit 64ab36de46d54413324dab33309e8b14dfc95760 parent 65a3822c6775678ee5e84adf9b78f58e583f9a29 Author: Vincent Forest <vincent.forest@meso-star.com> Date: Tue, 19 Oct 2021 15:45:50 +0200 Merge branch 'release_0.9' Diffstat:
75 files changed, 236 insertions(+), 137 deletions(-)
diff --git a/README.md b/README.md @@ -29,11 +29,19 @@ variable the install directories of its dependencies. ## Release notes +### Version 0.9 + +- Fix self-intersection on meshed mirrors. +- Sets the required version of Star-SampPling to 0.12. This version fixes + compilation errors with gcc 11 but introduces API breaks. +- Sets the required version of Star-3D to 0.8. +- Fix compilation warnings detected by gcc 11. + ### Version 0.8 -- Register into the estimator the final state of the RNG used during the - simulation. Add the `ssol_estimator_get_rng_state` function that returns this - state. +Register into the estimator the final state of the RNG used during the +simulation. Add the `ssol_estimator_get_rng_state` function that returns this +state. ### Version 0.7.3 @@ -42,12 +50,11 @@ variable the install directories of its dependencies. ### Version 0.7.2 -- Fix the gaussian sunshape. +Fix the gaussian sunshape. ### Version 0.7.1 -- Fix the creation of a glossy BSDF that uses a pillbox microfacet - distribution. +Fix the creation of a glossy BSDF that uses a pillbox microfacet distribution. ### Version 0.7 @@ -127,12 +134,12 @@ variable the install directories of its dependencies. - Fix the per primitive irradiance estimate by dividing the result by the area of the primitive in order to have watts per square meter. -## Licenses +## License + +Copyright (C) 2018, 2019, 2021 |Meso|Star> (<contact@meso-star.com>). +Copyright (C) 2016, 2018 CNRS. -Solstice-Solver is developed by [|Meso|Star>](http://www.meso-star.com) for the -[National Center for Scientific Research](http://www.cnrs.fr/index.php) (CNRS). -Copyright (C) 2016-2018 CNRS, 2018-2019 -[|Meso|Star>](http://www.meso-star.com). It is free software released under the -GPL v3+ license: GNU GPL version 3 or later. You are welcome to redistribute it -under certain conditions; refer to the COPYING file for details. +Solstice-Solver is free software released under the GPL v3+ license: GNU GPL +version 3 or later. You are welcome to redistribute it under certain +conditions; refer to the COPYING file for details. diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt @@ -1,4 +1,5 @@ -# Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +# Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) +# Copyright (C) 2016, 2018 CNRS # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -13,27 +14,23 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 3.1) project(solstice-solver C) enable_testing() -if(POLICY CMP0054) # For cmake version < 3.1: disable FindOpenMP warning - cmake_policy(SET CMP0054 NEW) -endif() - set(SSOL_SOURCE_DIR ${PROJECT_SOURCE_DIR}/../src) option(NO_TEST "Do not build tests" OFF) ################################################################################ # Check dependencies ################################################################################ -find_package(RCMake 0.3 REQUIRED) -find_package(RSys 0.7.1 REQUIRED) -find_package(Star3D 0.4.1 REQUIRED) -find_package(Star3DUT 0.2 REQUIRED) -find_package(StarCPR 0.1 REQUIRED) -find_package(StarSF 0.4 REQUIRED) -find_package(StarSP 0.8 REQUIRED) +find_package(RCMake 0.4 REQUIRED) +find_package(RSys 0.10 REQUIRED) +find_package(Star3D 0.8 REQUIRED) +find_package(Star3DUT 0.3.1 REQUIRED) +find_package(StarCPR 0.1.2 REQUIRED) +find_package(StarSF 0.6 REQUIRED) +find_package(StarSP 0.12 REQUIRED) find_package(OpenMP 1.2 REQUIRED) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${RCMAKE_SOURCE_DIR}) @@ -54,7 +51,7 @@ rcmake_append_runtime_dirs(_runtime_dirs RSys Star3D Star3DUT StarCPR StarSF Sta # Configure and define targets ################################################################################ set(VERSION_MAJOR 0) -set(VERSION_MINOR 8) +set(VERSION_MINOR 9) set(VERSION_PATCH 0) set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}) diff --git a/src/ssol.h b/src/ssol.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/ssol_atmosphere.c b/src/ssol_atmosphere.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/ssol_atmosphere_c.h b/src/ssol_atmosphere_c.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/ssol_c.h b/src/ssol_c.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -38,7 +39,7 @@ struct ray_data { enum ssol_side_flag side_from; /* Primitive side from which the ray starts */ short discard_virtual_materials; /* Define if virtual materials are not RT */ short reversed_ray; /* Define if the ray direction is reversed */ - float range_min; + int point_init_closest_point; /* Output data */ double N[3]; /* Normal of the nearest punched surface point */ @@ -46,7 +47,8 @@ struct ray_data { }; static const struct ray_data RAY_DATA_NULL = { - NULL, S3D_PRIMITIVE_NULL__, NULL, NULL, SSOL_INVALID_SIDE, 0, 0, 0, {0,0,0}, FLT_MAX + NULL, S3D_PRIMITIVE_NULL__, NULL, NULL, SSOL_INVALID_SIDE, 0, 0, 0, + {0,0,0}, FLT_MAX }; @@ -66,6 +68,7 @@ hit_filter_function (const struct s3d_hit* hit, const float org[3], const float dir[3], + const float range[2], void* realisation, void* filter_data); diff --git a/src/ssol_camera.c b/src/ssol_camera.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/ssol_camera.h b/src/ssol_camera.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/ssol_data.c b/src/ssol_data.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/ssol_device.c b/src/ssol_device.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/ssol_device_c.h b/src/ssol_device_c.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/ssol_draw.c b/src/ssol_draw.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/ssol_draw.h b/src/ssol_draw.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/ssol_draw_draft.c b/src/ssol_draw_draft.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -163,7 +164,7 @@ ssol_draw_draft res = darray_float_reserve(&samples, spp * 2/*#dimensions*/); if(res != RES_OK) goto error; - res = ssp_rng_create(scn->dev->allocator, &ssp_rng_threefry, &rng); + res = ssp_rng_create(scn->dev->allocator, SSP_RNG_THREEFRY, &rng); if(res != RES_OK) goto error; /* Generate the pixel samples */ diff --git a/src/ssol_draw_pt.c b/src/ssol_draw_pt.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -366,7 +367,7 @@ ssol_draw_pt /* Create a RNG proxy */ res = ssp_rng_proxy_create - (scn->dev->allocator, &ssp_rng_threefry, scn->dev->nthreads, &rng_proxy); + (scn->dev->allocator, SSP_RNG_THREEFRY, scn->dev->nthreads, &rng_proxy); if(res != RES_OK) goto error; res = sun_create_wavelength_distribution(scn->sun, &ran_sun_wl); diff --git a/src/ssol_estimator.c b/src/ssol_estimator.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -368,7 +369,7 @@ res_T estimator_save_rng_state (struct ssol_estimator* estimator, const struct ssp_rng_proxy* proxy) { - struct ssp_rng_type rng_type; + enum ssp_rng_type rng_type; FILE* stream = NULL; res_T res = RES_OK; ASSERT(estimator && proxy); @@ -388,7 +389,7 @@ estimator_save_rng_state } SSP(rng_proxy_get_type(proxy, &rng_type)); - res = ssp_rng_create(estimator->dev->allocator, &rng_type, &estimator->rng); + res = ssp_rng_create(estimator->dev->allocator, rng_type, &estimator->rng); if(res != RES_OK) { log_error(estimator->dev, "Could not create the RNG to save the proxy RNG state.\n"); diff --git a/src/ssol_estimator_c.h b/src/ssol_estimator_c.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/ssol_image.c b/src/ssol_image.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/ssol_image_c.h b/src/ssol_image_c.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/ssol_instance.c b/src/ssol_instance.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/ssol_instance_c.h b/src/ssol_instance_c.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/ssol_material.c b/src/ssol_material.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/ssol_material_c.h b/src/ssol_material_c.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/ssol_mc_receiver.c b/src/ssol_mc_receiver.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/ssol_object.c b/src/ssol_object.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/ssol_object_c.h b/src/ssol_object_c.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/ssol_param_buffer.c b/src/ssol_param_buffer.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/ssol_ranst_sun_dir.c b/src/ssol_ranst_sun_dir.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/ssol_ranst_sun_dir.h b/src/ssol_ranst_sun_dir.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/ssol_ranst_sun_wl.c b/src/ssol_ranst_sun_wl.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/ssol_ranst_sun_wl.h b/src/ssol_ranst_sun_wl.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/ssol_scene.c b/src/ssol_scene.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -439,6 +440,7 @@ hit_filter_function (const struct s3d_hit* hit, const float orgf[3], const float dirf[3], + const float rangef[2], void* ray_data, void* filter_data) { @@ -449,13 +451,20 @@ hit_filter_function enum ssol_side_flag hit_side = SSOL_INVALID_SIDE; double org[3], dir[3], N[3], dst = FLT_MAX; size_t id; - (void)filter_data; + (void)filter_data, (void)rangef; ASSERT(hit && orgf && dirf); /* No ray data => nothing to filter */ if(!ray_data) return 0; /* Handle numerical imprecision */ - if(hit->distance <= rdata->range_min) return 1; + if(hit->distance < rangef[0]) return 1; + + /* When searching for closest_point accept any point on the expected object */ + if(rdata->point_init_closest_point) { + int reject = (rdata->prim_from.geom_id != hit->prim.geom_id) + || (rdata->prim_from.inst_id != hit->prim.inst_id); + return reject; + } /* Retrieve the intersected instance and shaded shape */ inst = *htable_instance_find(&rdata->scn->instances_rt, &hit->prim.inst_id); @@ -466,7 +475,7 @@ hit_filter_function switch(sshape->shape->type) { case SHAPE_MESH: if(hit->distance <= 1.e-6 /* FIXME hack */ - || hit->distance <= rdata->range_min + || hit->distance <= rangef[0] || S3D_PRIMITIVE_EQ(&hit->prim, &rdata->prim_from)) { /* Discard self intersection for mesh, i.e. when the intersected * primitive is the primitive from which the ray starts */ @@ -486,7 +495,7 @@ hit_filter_function /* No projection found => the ray does not intersect the quadric */ return 1; } - if((float)dst <= rdata->range_min) { + if((float)dst <= rangef[0]) { /* Handle RT numerical imprecision, the hit is below the lower bound * of the ray range. */ return 1; diff --git a/src/ssol_scene_c.h b/src/ssol_scene_c.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/ssol_shape.c b/src/ssol_shape.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/ssol_shape_c.h b/src/ssol_shape_c.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -105,7 +106,7 @@ shape_fetched_raw_vertex_attrib (const struct ssol_shape* shape, const unsigned ivert, const enum ssol_attrib_usage usage, - double value[]); + double value[3]); /* Compute ray/punched shape intersection */ extern LOCAL_SYM int punched_shape_intersect_local diff --git a/src/ssol_solver.c b/src/ssol_solver.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -331,9 +332,22 @@ point_init ray_data.reversed_ray = 1; /* The ray direction is reversed */ ray_data.dst = FLT_MAX; + /* pt->prim must live in RT space */ + f3_set_d3(pos, pt->pos); + ray_data.point_init_closest_point = 1; + S3D(shape_get_id(pt->sshape->shape->shape_rt, &ray_data.prim_from.geom_id)); + S3D(shape_get_id(pt->inst->shape_rt, &ray_data.prim_from.inst_id)); + S3D(scene_view_closest_point(view_rt, pos, FLT_MAX, &ray_data, &hit)); + CHK(!S3D_HIT_NONE(&hit)); + /* Sample and RT meshes are supposed to be identical only for SHAPE_MESH */ + ASSERT(pt->sshape->shape->type != SHAPE_MESH + || hit.distance <= (1 + f3_len(pos)) * 1e-6); + pt->prim = hit.prim; + ray_data.prim_from = pt->prim; + /* Trace a ray toward the sun to check if the sampled point is occluded */ f3_minus(dir, f3_set_d3(dir, pt->dir)); - f3_set_d3(pos, pt->pos); + ray_data.point_init_closest_point = 0; S3D(scene_view_trace_ray(view_rt, pos, dir, range, &ray_data, &hit)); *is_lit = S3D_HIT_NONE(&hit); @@ -993,7 +1007,6 @@ trace_radiative_path ray_data.side_from = pt.side; ray_data.discard_virtual_materials = 0; ray_data.reversed_ray = 0; - ray_data.range_min = range[0]; ray_data.dst = FLT_MAX; S3D(scene_view_trace_ray(view_rt, org, dir, range, &ray_data, &hit)); if(S3D_HIT_NONE(&hit)) { /* The ray is lost! */ diff --git a/src/ssol_spectrum.c b/src/ssol_spectrum.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/ssol_spectrum_c.h b/src/ssol_spectrum_c.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/ssol_sun.c b/src/ssol_sun.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/ssol_sun_c.h b/src/ssol_sun_c.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/test_ssol_atmosphere.c b/src/test_ssol_atmosphere.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/test_ssol_by_receiver_integration.c b/src/test_ssol_by_receiver_integration.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -81,7 +82,7 @@ main(int argc, char** argv) CHK(ssol_device_create (NULL, &allocator, SSOL_NTHREADS_DEFAULT, 0, &dev) == RES_OK); - CHK(ssp_rng_create(&allocator, &ssp_rng_threefry, &rng) == RES_OK); + CHK(ssp_rng_create(&allocator, SSP_RNG_THREEFRY, &rng) == RES_OK); CHK(ssol_spectrum_create(dev, &spectrum) == RES_OK); CHK(ssol_spectrum_setup(spectrum, get_wlen, 3, NULL) == RES_OK); CHK(ssol_sun_create_directional(dev, &sun) == RES_OK); diff --git a/src/test_ssol_camera.c b/src/test_ssol_camera.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/test_ssol_circ2D_geometry.h b/src/test_ssol_circ2D_geometry.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/test_ssol_cube_geometry.h b/src/test_ssol_cube_geometry.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -69,7 +70,7 @@ static const float EDGES__ [] = { X_MAX, Y_MAX, Z_MAX }; -const unsigned CUBE_NVERTS__ = sizeof(EDGES__) / sizeof(float[3]); +const unsigned CUBE_NVERTS__ = sizeof(EDGES__) / (3*sizeof(float)); const unsigned TRG_IDS__ [] = { 0, 6, 4, @@ -85,7 +86,7 @@ const unsigned TRG_IDS__ [] = { 1, 5, 7, 1, 7, 3 }; -const unsigned CUBE_NTRIS__ = sizeof(TRG_IDS__) / sizeof(unsigned[3]); +const unsigned CUBE_NTRIS__ = sizeof(TRG_IDS__) / (3*sizeof(unsigned)); static const struct desc CUBE_DESC__ = { EDGES__, TRG_IDS__ }; diff --git a/src/test_ssol_data.c b/src/test_ssol_data.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/test_ssol_device.c b/src/test_ssol_device.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/test_ssol_draw.c b/src/test_ssol_draw.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/test_ssol_geometries.h b/src/test_ssol_geometries.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/test_ssol_image.c b/src/test_ssol_image.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/test_ssol_instance.c b/src/test_ssol_instance.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/test_ssol_material.c b/src/test_ssol_material.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/test_ssol_materials.h b/src/test_ssol_materials.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/test_ssol_object.c b/src/test_ssol_object.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/test_ssol_param_buffer.c b/src/test_ssol_param_buffer.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/test_ssol_rect2D_geometry.h b/src/test_ssol_rect2D_geometry.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -55,7 +56,7 @@ static double EDGES__ [] = { X_MAX, Y_MIN }; -const unsigned POLY_NVERTS__ = sizeof(EDGES__) / sizeof(double[2]); +const unsigned POLY_NVERTS__ = sizeof(EDGES__) / (2*sizeof(double)); #undef EDGES__ #undef POLY_NVERTS__ diff --git a/src/test_ssol_rect_geometry.h b/src/test_ssol_rect_geometry.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -57,10 +58,10 @@ static const float EDGES__ [] = { X_MIN, Y_MAX, 0.f }; -const unsigned RECT_NVERTS__ = sizeof(EDGES__) / sizeof(float[3]); +const unsigned RECT_NVERTS__ = sizeof(EDGES__) / (3*sizeof(float)); const unsigned TRG_IDS__ [] = { 0, 2, 1, 2, 0, 3 }; -const unsigned RECT_NTRIS__ = sizeof(TRG_IDS__) / sizeof(unsigned[3]); +const unsigned RECT_NTRIS__ = sizeof(TRG_IDS__) / (3*sizeof(unsigned)); static const struct desc RECT_DESC__ = { EDGES__, TRG_IDS__ }; diff --git a/src/test_ssol_scene.c b/src/test_ssol_scene.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/test_ssol_shape.c b/src/test_ssol_shape.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -35,7 +36,7 @@ main(int argc, char** argv) double polygon[] = { -1.0, -1.0, -1.0, 1.0, 1.0, 1.0, 1.0, -1.0, 0.f, -2.f }; - const size_t npolygon_verts = sizeof(polygon)/sizeof(double[2]); + const size_t npolygon_verts = sizeof(polygon)/(2*sizeof(double)); double val[3]; unsigned ids[3]; unsigned i, n; diff --git a/src/test_ssol_solver1.c b/src/test_ssol_solver1.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -54,8 +55,8 @@ main(int argc, char** argv) struct ssp_rng* rng; struct ssp_rng* rng2; const struct ssp_rng* rng_state; - struct ssp_rng_type rng_type0; - struct ssp_rng_type rng_type1; + enum ssp_rng_type rng_type0; + enum ssp_rng_type rng_type1; struct ssol_scene* scene; struct ssol_shape* dummy; struct ssol_shape* square; @@ -111,7 +112,7 @@ main(int argc, char** argv) CHK(ssol_device_create (NULL, &allocator, SSOL_NTHREADS_DEFAULT, 0, &dev) == RES_OK); - CHK(ssp_rng_create(&allocator, &ssp_rng_threefry, &rng) == RES_OK); + CHK(ssp_rng_create(&allocator, SSP_RNG_THREEFRY, &rng) == RES_OK); desc.wavelengths = wavelengths; desc.intensities = intensities; @@ -247,11 +248,11 @@ main(int argc, char** argv) CHK(ssol_estimator_get_rng_state(estimator, &rng_state) == RES_OK); CHK(ssp_rng_get_type(rng_state, &rng_type0) == RES_OK); CHK(ssp_rng_get_type(rng, &rng_type1) == RES_OK); - CHK(ssp_rng_type_eq(&rng_type0, &rng_type1)); + CHK(rng_type0 == rng_type1); /* Clone the rng_state */ CHK(stream = tmpfile()); - CHK(ssp_rng_create(&allocator, &ssp_rng_threefry, &rng2) == RES_OK); + CHK(ssp_rng_create(&allocator, SSP_RNG_THREEFRY, &rng2) == RES_OK); CHK(ssp_rng_write(rng_state, stream) == RES_OK); rewind(stream); CHK(ssp_rng_read(rng2, stream) == RES_OK); diff --git a/src/test_ssol_solver10.c b/src/test_ssol_solver10.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -91,7 +92,7 @@ main(int argc, char** argv) (NULL, &allocator, SSOL_NTHREADS_DEFAULT, 0, &dev) == RES_OK); #define DNI 1000 - CHK(ssp_rng_create(&allocator, &ssp_rng_threefry, &rng) == RES_OK); + CHK(ssp_rng_create(&allocator, SSP_RNG_THREEFRY, &rng) == RES_OK); CHK(ssol_spectrum_create(dev, &spectrum) == RES_OK); CHK(ssol_spectrum_setup(spectrum, get_wlen, 3, NULL) == RES_OK); CHK(ssol_sun_create_pillbox(dev, &sun) == RES_OK); diff --git a/src/test_ssol_solver11.c b/src/test_ssol_solver11.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -91,7 +92,7 @@ main(int argc, char** argv) (NULL, &allocator, SSOL_NTHREADS_DEFAULT, 0, &dev) == RES_OK); #define DNI 1000 - CHK(ssp_rng_create(&allocator, &ssp_rng_threefry, &rng) == RES_OK); + CHK(ssp_rng_create(&allocator, SSP_RNG_THREEFRY, &rng) == RES_OK); CHK(ssol_spectrum_create(dev, &spectrum) == RES_OK); CHK(ssol_spectrum_setup(spectrum, get_wlen, 3, NULL) == RES_OK); CHK(ssol_sun_create_buie(dev, &sun) == RES_OK); diff --git a/src/test_ssol_solver12.c b/src/test_ssol_solver12.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -91,7 +92,7 @@ main(int argc, char** argv) (NULL, &allocator, SSOL_NTHREADS_DEFAULT, 0, &dev) == RES_OK); #define DNI 1000 - CHK(ssp_rng_create(&allocator, &ssp_rng_threefry, &rng) == RES_OK); + CHK(ssp_rng_create(&allocator, SSP_RNG_THREEFRY, &rng) == RES_OK); CHK(ssol_spectrum_create(dev, &spectrum) == RES_OK); CHK(ssol_spectrum_setup(spectrum, get_wlen, 3, NULL) == RES_OK); CHK(ssol_sun_create_gaussian(dev, &sun) == RES_OK); diff --git a/src/test_ssol_solver2.c b/src/test_ssol_solver2.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -104,7 +105,7 @@ main(int argc, char** argv) CHK(ssol_device_create (NULL, &allocator, SSOL_NTHREADS_DEFAULT, 0, &dev) == RES_OK); - CHK(ssp_rng_create(&allocator, &ssp_rng_threefry, &rng) == RES_OK); + CHK(ssp_rng_create(&allocator, SSP_RNG_THREEFRY, &rng) == RES_OK); CHK(ssol_spectrum_create(dev, &spectrum) == RES_OK); CHK(ssol_spectrum_setup(spectrum, get_wlen, 3, NULL) == RES_OK); CHK(ssol_sun_create_directional(dev, &sun) == RES_OK); diff --git a/src/test_ssol_solver2b.c b/src/test_ssol_solver2b.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -103,7 +104,7 @@ main(int argc, char** argv) CHK(ssol_device_create (NULL, &allocator, SSOL_NTHREADS_DEFAULT, 0, &dev) == RES_OK); - CHK(ssp_rng_create(&allocator, &ssp_rng_threefry, &rng) == RES_OK); + CHK(ssp_rng_create(&allocator, SSP_RNG_THREEFRY, &rng) == RES_OK); CHK(ssol_spectrum_create(dev, &spectrum) == RES_OK); CHK(ssol_spectrum_setup(spectrum, get_wlen, 3, NULL) == RES_OK); CHK(ssol_sun_create_directional(dev, &sun) == RES_OK); diff --git a/src/test_ssol_solver3.c b/src/test_ssol_solver3.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -84,7 +85,7 @@ main(int argc, char** argv) CHK(ssol_device_create (NULL, &allocator, SSOL_NTHREADS_DEFAULT, 0, &dev) == RES_OK); - CHK(ssp_rng_create(&allocator, &ssp_rng_threefry, &rng) == RES_OK); + CHK(ssp_rng_create(&allocator, SSP_RNG_THREEFRY, &rng) == RES_OK); CHK(ssol_spectrum_create(dev, &spectrum) == RES_OK); CHK(ssol_spectrum_setup(spectrum, get_wlen, 3, NULL) == RES_OK); CHK(ssol_sun_create_directional(dev, &sun) == RES_OK); diff --git a/src/test_ssol_solver4.c b/src/test_ssol_solver4.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -85,7 +86,7 @@ main(int argc, char** argv) CHK(ssol_device_create (NULL, &allocator, SSOL_NTHREADS_DEFAULT, 0, &dev) == RES_OK); - CHK(ssp_rng_create(&allocator, &ssp_rng_threefry, &rng) == RES_OK); + CHK(ssp_rng_create(&allocator, SSP_RNG_THREEFRY, &rng) == RES_OK); CHK(ssol_spectrum_create(dev, &spectrum) == RES_OK); CHK(ssol_spectrum_setup(spectrum, get_wlen, 3, NULL) == RES_OK); CHK(ssol_sun_create_directional(dev, &sun) == RES_OK); diff --git a/src/test_ssol_solver5.c b/src/test_ssol_solver5.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -84,7 +85,7 @@ main(int argc, char** argv) CHK(ssol_device_create (NULL, &allocator, SSOL_NTHREADS_DEFAULT, 0, &dev) == RES_OK); - CHK(ssp_rng_create(&allocator, &ssp_rng_threefry, &rng) == RES_OK); + CHK(ssp_rng_create(&allocator, SSP_RNG_THREEFRY, &rng) == RES_OK); CHK(ssol_spectrum_create(dev, &spectrum) == RES_OK); CHK(ssol_spectrum_setup(spectrum, get_wlen, 3, NULL) == RES_OK); CHK(ssol_sun_create_directional(dev, &sun) == RES_OK); diff --git a/src/test_ssol_solver6.c b/src/test_ssol_solver6.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -90,7 +91,7 @@ main(int argc, char** argv) CHK(ssol_device_create (NULL, &allocator, SSOL_NTHREADS_DEFAULT, 0, &dev) == RES_OK); - CHK(ssp_rng_create(&allocator, &ssp_rng_threefry, &rng) == RES_OK); + CHK(ssp_rng_create(&allocator, SSP_RNG_THREEFRY, &rng) == RES_OK); CHK(ssol_spectrum_create(dev, &spectrum) == RES_OK); CHK(ssol_spectrum_setup(spectrum, get_wlen, 3, NULL) == RES_OK); CHK(ssol_sun_create_directional(dev, &sun) == RES_OK); diff --git a/src/test_ssol_solver7.c b/src/test_ssol_solver7.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -102,7 +103,7 @@ main(int argc, char** argv) CHK(ssol_device_create(NULL, &allocator, 1, 0, &dev) == RES_OK); - CHK(ssp_rng_create(&allocator, &ssp_rng_threefry, &rng) == RES_OK); + CHK(ssp_rng_create(&allocator, SSP_RNG_THREEFRY, &rng) == RES_OK); CHK(ssol_spectrum_create(dev, &spectrum) == RES_OK); CHK(ssol_spectrum_setup(spectrum, get_wlen, 3, NULL) == RES_OK); CHK(ssol_sun_create_directional(dev, &sun) == RES_OK); diff --git a/src/test_ssol_solver8.c b/src/test_ssol_solver8.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -87,7 +88,7 @@ main(int argc, char** argv) (NULL, &allocator, SSOL_NTHREADS_DEFAULT, 0, &dev) == RES_OK); #define DNI 1000 - CHK(ssp_rng_create(&allocator, &ssp_rng_threefry, &rng) == RES_OK); + CHK(ssp_rng_create(&allocator, SSP_RNG_THREEFRY, &rng) == RES_OK); CHK(ssol_spectrum_create(dev, &spectrum) == RES_OK); CHK(ssol_spectrum_setup(spectrum, get_wlen, 3, NULL) == RES_OK); CHK(ssol_sun_create_directional(dev, &sun) == RES_OK); diff --git a/src/test_ssol_solver9.c b/src/test_ssol_solver9.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -89,7 +90,7 @@ main(int argc, char** argv) (NULL, &allocator, SSOL_NTHREADS_DEFAULT, 0, &dev) == RES_OK); #define DNI 1000 - CHK(ssp_rng_create(&allocator, &ssp_rng_threefry, &rng) == RES_OK); + CHK(ssp_rng_create(&allocator, SSP_RNG_THREEFRY, &rng) == RES_OK); CHK(ssol_spectrum_create(dev, &spectrum) == RES_OK); CHK(ssol_spectrum_setup(spectrum, get_wlen, 3, NULL) == RES_OK); CHK(ssol_sun_create_directional(dev, &sun) == RES_OK); diff --git a/src/test_ssol_spectrum.c b/src/test_ssol_spectrum.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/test_ssol_sun.c b/src/test_ssol_sun.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/test_ssol_utils.h b/src/test_ssol_utils.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2016-2018 CNRS, 2018-2019 |Meso|Star> +/* Copyright (C) 2018, 2019, 2021 |Meso|Star> (contact@meso-star.com) + * Copyright (C) 2016, 2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by