--- ray/src/rt/pmapray.c 2015/09/01 16:27:53 2.5 +++ ray/src/rt/pmapray.c 2024/03/22 16:54:16 2.8 @@ -1,6 +1,7 @@ #ifndef lint -static const char RCSid[] = "$Id: pmapray.c,v 2.5 2015/09/01 16:27:53 greg Exp $"; +static const char RCSid[] = "$Id: pmapray.c,v 2.8 2024/03/22 16:54:16 greg Exp $"; #endif + /* ================================================================== Photon map interface to RADIANCE raycalls @@ -11,9 +12,11 @@ static const char RCSid[] = "$Id: pmapray.c,v 2.5 2015 supported by the Swiss National Science Foundation (SNSF, #147053) ================================================================== + $Id: pmapray.c,v 2.8 2024/03/22 16:54:16 greg Exp $ */ +#include "ray.h" #include "pmapray.h" #include "pmap.h" @@ -21,6 +24,9 @@ static const char RCSid[] = "$Id: pmapray.c,v 2.5 2015 void ray_init_pmap () /* Interface to ray_init(); init & load photon maps */ { + if (NCSAMP > 3 && photonMapping) + error(USER, "photon-mapping not currently supported for > 3 spectral samples"); + loadPmaps(photonMaps, pmapParams); } @@ -45,6 +51,7 @@ void ray_save_pmap (RAYPARAMS *rp) rp -> pmapParams [t].minGather = pmapParams [t].minGather; rp -> pmapParams [t].maxGather = pmapParams [t].maxGather; + rp -> pmapParams [t].distribTarget = pmapParams [t].distribTarget; } } @@ -58,5 +65,19 @@ void ray_restore_pmap (RAYPARAMS *rp) pmapParams [t].fileName = rp -> pmapParams [t].fileName; pmapParams [t].minGather = rp -> pmapParams [t].minGather; pmapParams [t].maxGather = rp -> pmapParams [t].maxGather; + pmapParams [t].distribTarget = rp -> pmapParams [t].distribTarget; + } +} + +void ray_defaults_pmap (RAYPARAMS *rp) +/* Interface to ray_defaults(); set photon mapping defaults */ +{ + unsigned t; + + for (t = 0; t < NUM_PMAP_TYPES; t++) { + rp -> pmapParams [t].fileName = NULL; + rp -> pmapParams [t].minGather = 0; + rp -> pmapParams [t].maxGather = 0; + rp -> pmapParams [t].distribTarget = 0; } }