4 |
|
|
5 |
|
Roland Schregle (roland.schregle@{hslu.ch, gmail.com}) |
6 |
|
(c) Fraunhofer Institute for Solar Energy Systems, |
7 |
< |
Lucerne University of Applied Sciences & Arts |
7 |
> |
(c) Lucerne University of Applied Sciences and Arts, |
8 |
> |
supported by the Swiss National Science Foundation (SNSF, #147053) |
9 |
|
================================================================== |
10 |
|
|
11 |
|
$Id$ |
18 |
|
#include "pmap.h" |
19 |
|
|
20 |
|
/* |
21 |
< |
Checks for paths already accounted for in photon map to avoid |
21 |
> |
Check for paths already accounted for in photon map to avoid |
22 |
|
double-counting during backward raytracing. |
23 |
|
|
23 |
– |
ambRayInPmap(): Check for DIFFUSE -> (DIFFUSE|SPECULAR) -> * |
24 |
– |
subpaths. These occur during the backward pass |
25 |
– |
when an ambient ray spawns an indirect diffuse or |
26 |
– |
specular ray. These subpaths are already |
27 |
– |
accounted for in the global photon map. |
28 |
– |
|
24 |
|
shadowRayInPmap(): Check for DIFFUSE -> SPECULAR -> LIGHT |
25 |
|
subpaths. These occur during the backward pass |
26 |
|
when a shadow ray is transferred through a |
28 |
|
accounted for by caustic photons in the global, |
29 |
|
contrib, or dedicated caustic photon map. |
30 |
|
*/ |
31 |
< |
#define ambRayInPmap(r) ((r) -> crtype & AMBIENT && photonMapping) |
32 |
< |
|
31 |
> |
/* |
32 |
> |
#define ambRayInPmap(r) ((r) -> crtype & AMBIENT && \ |
33 |
> |
((photonMapping && \ |
34 |
> |
(ambounce < 0 || (r) -> rlvl > 1)) || \ |
35 |
> |
causticPhotonMapping || contribPhotonMapping)) |
36 |
> |
*/ |
37 |
> |
#define ambRayInPmap(r) 0 |
38 |
|
#define shadowRayInPmap(r) ((r) -> crtype & SHADOW && \ |
39 |
< |
((photonMapping && ambounce < 0) || \ |
40 |
< |
(causticPhotonMapping || \ |
41 |
< |
contribPhotonMapping))) |
39 |
> |
(ambounce < 0 || ((r) -> crtype & AMBIENT ? \ |
40 |
> |
photonMapping : causticPhotonMapping))) |
41 |
|
|
42 |
|
/* Check if scattered ray spawns a caustic photon */ |
43 |
|
#define PMAP_CAUSTICRAY(r) ((r) -> rtype & SPECULAR) |