| 1 |
greg |
2.3 |
#ifndef lint
|
| 2 |
rschregle |
2.6 |
static const char RCSid[] = "$Id: pmaprand.c,v 2.5 2016/05/17 17:39:47 rschregle Exp $";
|
| 3 |
greg |
2.3 |
#endif
|
| 4 |
rschregle |
2.5 |
|
| 5 |
greg |
2.1 |
/*
|
| 6 |
rschregle |
2.6 |
======================================================================
|
| 7 |
greg |
2.1 |
Random number generators for photon distribution
|
| 8 |
|
|
|
| 9 |
|
|
Roland Schregle (roland.schregle@{hslu.ch, gmail.com})
|
| 10 |
|
|
(c) Fraunhofer Institute for Solar Energy Systems,
|
| 11 |
rschregle |
2.2 |
(c) Lucerne University of Applied Sciences and Arts,
|
| 12 |
rschregle |
2.6 |
supported by the Swiss National Science Foundation (SNSF, #147053)
|
| 13 |
|
|
======================================================================
|
| 14 |
greg |
2.1 |
|
| 15 |
rschregle |
2.6 |
$Id: pmaprand.c,v 2.5 2016/05/17 17:39:47 rschregle Exp $
|
| 16 |
greg |
2.1 |
*/
|
| 17 |
|
|
|
| 18 |
|
|
|
| 19 |
|
|
|
| 20 |
|
|
/*
|
| 21 |
rschregle |
2.6 |
Separate RNG states are used for the following sampling domains during
|
| 22 |
|
|
photon distribution:
|
| 23 |
greg |
2.1 |
|
| 24 |
|
|
- source partition
|
| 25 |
|
|
- emission direction
|
| 26 |
|
|
- emission counter fraction
|
| 27 |
|
|
- mean free distance in medium
|
| 28 |
|
|
- scattering direction
|
| 29 |
|
|
- russian roulette.
|
| 30 |
|
|
|
| 31 |
rschregle |
2.6 |
In addition, each photon map also has a local state randState used for
|
| 32 |
|
|
distribRatio during distribution and for bias compensation during
|
| 33 |
|
|
gathering.
|
| 34 |
greg |
2.1 |
|
| 35 |
rschregle |
2.6 |
The random seed randSeed can be added to each initial state with
|
| 36 |
|
|
pmapSeed() so the RNGs can be externally seeded if necessary.
|
| 37 |
greg |
2.1 |
*/
|
| 38 |
|
|
|
| 39 |
|
|
unsigned short partState [3] = {47717, 5519, 21521},
|
| 40 |
|
|
emitState [3] = {33997, 59693, 11003},
|
| 41 |
|
|
cntState [3] = {17077, 4111, 48907},
|
| 42 |
|
|
mediumState [3] = {25247, 7507, 33797},
|
| 43 |
|
|
scatterState [3] = {21863, 45191, 5099},
|
| 44 |
|
|
rouletteState [3] = {10243, 39829, 9433},
|
| 45 |
|
|
randSeed = 0;
|