--- ray/src/common/bsdf.c 2011/02/19 23:42:09 2.17 +++ ray/src/common/bsdf.c 2011/04/08 23:23:28 2.18 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: bsdf.c,v 2.17 2011/02/19 23:42:09 greg Exp $"; +static const char RCSid[] = "$Id: bsdf.c,v 2.18 2011/04/08 23:23:28 greg Exp $"; #endif /* * bsdf.c @@ -451,7 +451,7 @@ SDmultiSamp(double t[], int n, double randX) bitmask_t ndx, coord[MS_MAXDIM]; while (n > MS_MAXDIM) /* punt for higher dimensions */ - t[--n] = drand48(); + t[--n] = rand()*(1./RAND_MAX); nBits = (8*sizeof(bitmask_t) - 1) / n; ndx = randX * (double)((bitmask_t)1 << (nBits*n)); /* get coordinate on Hilbert curve */ @@ -459,7 +459,7 @@ SDmultiSamp(double t[], int n, double randX) /* convert back to [0,1) range */ scale = 1. / (double)((bitmask_t)1 << nBits); while (n--) - t[n] = scale * ((double)coord[n] + drand48()); + t[n] = scale * ((double)coord[n] + rand()*(1./RAND_MAX)); } #undef MS_MAXDIM