ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/bsdf.c
(Generate patch)

Comparing ray/src/common/bsdf.c (file contents):
Revision 2.17 by greg, Sat Feb 19 23:42:09 2011 UTC vs.
Revision 2.18 by greg, Fri Apr 8 23:23:28 2011 UTC

# Line 451 | Line 451 | SDmultiSamp(double t[], int n, double randX)
451          bitmask_t       ndx, coord[MS_MAXDIM];
452          
453          while (n > MS_MAXDIM)           /* punt for higher dimensions */
454 <                t[--n] = drand48();
454 >                t[--n] = rand()*(1./RAND_MAX);
455          nBits = (8*sizeof(bitmask_t) - 1) / n;
456          ndx = randX * (double)((bitmask_t)1 << (nBits*n));
457                                          /* get coordinate on Hilbert curve */
# Line 459 | Line 459 | SDmultiSamp(double t[], int n, double randX)
459                                          /* convert back to [0,1) range */
460          scale = 1. / (double)((bitmask_t)1 << nBits);
461          while (n--)
462 <                t[n] = scale * ((double)coord[n] + drand48());
462 >                t[n] = scale * ((double)coord[n] + rand()*(1./RAND_MAX));
463   }
464  
465   #undef MS_MAXDIM

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines