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 |
|
|
24 |
– |
ambRayInPmap(): Check for DIFFUSE -> (DIFFUSE|SPECULAR) -> * |
25 |
– |
subpaths. These occur during the backward pass |
26 |
– |
when an ambient ray spawns an indirect diffuse or |
27 |
– |
specular ray. These subpaths are already |
28 |
– |
accounted for in the global photon map. |
29 |
– |
|
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 |
|
*/ |
37 |
– |
#define ambRayInPmap(r) ((r) -> crtype & AMBIENT && \ |
38 |
– |
((photonMapping && \ |
39 |
– |
(ambounce < 0 || (r) -> rlvl > 1)) || \ |
40 |
– |
causticPhotonMapping || contribPhotonMapping)) |
31 |
|
#define shadowRayInPmap(r) ((r) -> crtype & SHADOW && \ |
32 |
< |
photonMapping) |
32 |
> |
(ambounce < 0 || ((r) -> crtype & AMBIENT ? \ |
33 |
> |
photonMapping : causticPhotonMapping))) |
34 |
|
|
35 |
|
/* Check if scattered ray spawns a caustic photon */ |
36 |
|
#define PMAP_CAUSTICRAY(r) ((r) -> rtype & SPECULAR) |