--- ray/src/rt/raycalls.c 2005/06/14 02:46:30 2.13 +++ ray/src/rt/raycalls.c 2006/04/05 06:22:56 2.16 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: raycalls.c,v 2.13 2005/06/14 02:46:30 greg Exp $"; +static const char RCSid[] = "$Id: raycalls.c,v 2.16 2006/04/05 06:22:56 greg Exp $"; #endif /* * raycalls.c - interface for running Radiance rendering as a library @@ -90,6 +90,7 @@ static const char RCSid[] = "$Id: raycalls.c,v 2.13 20 */ #include +#include #include "ray.h" #include "source.h" @@ -164,7 +165,13 @@ ray_init( /* initialize ray-tracing calculation */ if (ofun[OBJ_SPHERE].funp == o_default) initotypes(); /* initialize urand */ - initurand(2048); + if (rand_samp) { + srandom((long)time(0)); + initurand(0); + } else { + srandom(0L); + initurand(2048); + } /* read scene octree */ readoct(octname = otnm, ~(IO_FILES|IO_INFO), &thescene, NULL); nsceneobjs = nobjects; @@ -181,7 +188,7 @@ ray_trace( /* trace a primary ray */ ) { rayorigin(r, PRIMARY, NULL, NULL); - samplendx = rand_samp ? random() : samplendx+1; + samplendx++; rayvalue(r); /* assumes origin and direction are set */ }