--- ray/src/rt/raycalls.c 2005/04/19 01:15:06 2.11 +++ ray/src/rt/raycalls.c 2005/06/14 02:46:30 2.13 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: raycalls.c,v 2.11 2005/04/19 01:15:06 greg Exp $"; +static const char RCSid[] = "$Id: raycalls.c,v 2.13 2005/06/14 02:46:30 greg Exp $"; #endif /* * raycalls.c - interface for running Radiance rendering as a library @@ -118,6 +118,8 @@ void (*addobjnotify[8])() = {ambnotify, NULL}; int do_irrad = 0; /* compute irradiance? */ +int rand_samp = 0; /* pure Monte Carlo sampling? */ + double dstrsrc = 0.0; /* square source distribution */ double shadthresh = .03; /* shadow threshold */ double shadcert = .75; /* shadow certainty */ @@ -179,7 +181,7 @@ ray_trace( /* trace a primary ray */ ) { rayorigin(r, PRIMARY, NULL, NULL); - samplendx++; + samplendx = rand_samp ? random() : samplendx+1; rayvalue(r); /* assumes origin and direction are set */ }