ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/pmaprand.h
(Generate patch)

Comparing ray/src/rt/pmaprand.h (file contents):
Revision 2.6 by schorsch, Sun Mar 6 01:13:18 2016 UTC vs.
Revision 2.7 by rschregle, Tue May 17 17:39:47 2016 UTC

# Line 1 | Line 1
1   /* RCSid $Id$ */
2 #ifndef PMAPRAND_H
3 #define PMAPRAND_H
2  
3   /*
4     ==================================================================
# Line 12 | Line 10
10     supported by the Swiss National Science Foundation (SNSF, #147053)
11     ==================================================================
12    
13 +   $Id$
14   */
15  
16  
17  
18 < /* According to the analytical validation, skipping numbers in the sequence
19 <   introduces bias in scenes with high reflectance. We therefore use
21 <   erand48() with separate states for photon emission, scattering, and
22 <   russian roulette. The pmapSeed() and pmapRandom() macros can be adapted
23 <   to other (better?) RNGs. */  
18 > #ifndef PMAPRAND_H
19 >   #define PMAPRAND_H
20  
21 < #if defined(_WIN32) || defined(_WIN64) || defined(BSD)
21 >   /* According to the analytical validation, skipping numbers in the sequence
22 >      introduces bias in scenes with high reflectance. We therefore use
23 >      erand48() with separate states for photon emission, scattering, and
24 >      russian roulette.  The pmapSeed() and pmapRandom() macros can be
25 >      adapted to other (better?) RNGs.  */
26 >
27 > #if defined(_WIN32) || defined(BSD)
28     /* Assume no erand48(), so use standard RNG without explicit multistate
29        control; the resulting sequences will be suboptimal */      
30     #include "random.h"
31 <  
31 >      
32     #define pmapSeed(seed, state) (srandom(seed))
33     #define pmapRandom(state)     (frandom())
34   #else
# Line 35 | Line 37
37     #define pmapRandom(state) erand48(state)
38   #endif
39  
40 <  
41 < extern unsigned short partState [3], emitState [3], cntState [3],
42 <                      mediumState [3], scatterState [3], rouletteState [3],
43 <                      randSeed;
42 <
40 >      
41 >   extern unsigned short partState [3], emitState [3], cntState [3],
42 >                         mediumState [3], scatterState [3], rouletteState [3],
43 >                         randSeed;
44   #endif
45  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines