1 |
+ |
/* RCSid $Id$ */ |
2 |
|
/* |
3 |
|
================================================================== |
4 |
|
Photon map support routines for scattering by materials. |
19 |
|
#include "pmap.h" |
20 |
|
|
21 |
|
/* |
22 |
< |
Checks for paths already accounted for in photon map to avoid |
22 |
> |
Check for paths already accounted for in photon map to avoid |
23 |
|
double-counting during backward raytracing. |
24 |
|
|
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 |
– |
|
25 |
|
shadowRayInPmap(): Check for DIFFUSE -> SPECULAR -> LIGHT |
26 |
|
subpaths. These occur during the backward pass |
27 |
|
when a shadow ray is transferred through a |
29 |
|
accounted for by caustic photons in the global, |
30 |
|
contrib, or dedicated caustic photon map. |
31 |
|
*/ |
32 |
+ |
/* |
33 |
|
#define ambRayInPmap(r) ((r) -> crtype & AMBIENT && \ |
34 |
|
((photonMapping && \ |
35 |
|
(ambounce < 0 || (r) -> rlvl > 1)) || \ |
36 |
|
causticPhotonMapping || contribPhotonMapping)) |
37 |
+ |
*/ |
38 |
+ |
#define ambRayInPmap(r) 0 |
39 |
|
#define shadowRayInPmap(r) ((r) -> crtype & SHADOW && \ |
40 |
< |
photonMapping) |
40 |
> |
(ambounce < 0 || ((r) -> crtype & AMBIENT ? \ |
41 |
> |
photonMapping : causticPhotonMapping))) |
42 |
|
|
43 |
|
/* Check if scattered ray spawns a caustic photon */ |
44 |
|
#define PMAP_CAUSTICRAY(r) ((r) -> rtype & SPECULAR) |