ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/pmapmat.h
Revision: 2.7
Committed: Wed Jul 29 18:54:20 2015 UTC (8 years, 9 months ago) by rschregle
Content type: text/plain
Branch: MAIN
Changes since 2.6: +8 -1 lines
Log Message:
Fixed bug with handling of -am rendering option, removed redundant code

File Contents

# User Rev Content
1 greg 2.1 /*
2     ==================================================================
3     Photon map support routines for scattering by materials.
4    
5     Roland Schregle (roland.schregle@{hslu.ch, gmail.com})
6     (c) Fraunhofer Institute for Solar Energy Systems,
7 rschregle 2.2 (c) Lucerne University of Applied Sciences and Arts,
8     supported by the Swiss National Science Foundation (SNSF, #147053)
9 greg 2.1 ==================================================================
10    
11 rschregle 2.7 $Id: pmapmat.h,v 4.13 2015/07/29 17:48:06 taschreg Exp taschreg $
12 greg 2.1 */
13    
14    
15     #ifndef PMAPMAT_H
16     #define PMAPMAT_H
17    
18     #include "pmap.h"
19    
20     /*
21 greg 2.5 Check for paths already accounted for in photon map to avoid
22 greg 2.1 double-counting during backward raytracing.
23    
24     shadowRayInPmap(): Check for DIFFUSE -> SPECULAR -> LIGHT
25     subpaths. These occur during the backward pass
26     when a shadow ray is transferred through a
27     transparent material. These subpaths are already
28     accounted for by caustic photons in the global,
29     contrib, or dedicated caustic photon map.
30     */
31 rschregle 2.7 /*
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 greg 2.1 #define shadowRayInPmap(r) ((r) -> crtype & SHADOW && \
39 greg 2.6 (ambounce < 0 || ((r) -> crtype & AMBIENT ? \
40     photonMapping : causticPhotonMapping)))
41 greg 2.1
42     /* Check if scattered ray spawns a caustic photon */
43     #define PMAP_CAUSTICRAY(r) ((r) -> rtype & SPECULAR)
44    
45    
46     /* Scattered photon ray types for photonRay() */
47     #define PMAP_DIFFREFL (REFLECTED | AMBIENT)
48     #define PMAP_DIFFTRANS (REFLECTED | AMBIENT | TRANS)
49     #define PMAP_SPECREFL (REFLECTED | SPECULAR)
50     #define PMAP_SPECTRANS (REFLECTED | SPECULAR | TRANS)
51     #define PMAP_REFRACT (REFRACTED | SPECULAR)
52     #define PMAP_XFER (TRANS)
53    
54    
55    
56     /* Dispatch table for photon scattering functions */
57     extern int (*photonScatter []) (OBJREC*, RAY*);
58    
59     /* List of antimatter sensor modifier names */
60     extern char *photonSensorList [MAXSET + 1];
61    
62    
63    
64     /* Spawn a new photon ray from a previous one; this is effectively a
65     * customised rayorigin(). */
66     void photonRay (const RAY *rayIn, RAY *rayOut, int rayOutType,
67     COLOR fluxAtten);
68    
69     /* Init photonScatter[] dispatch table with material specific scattering
70     routines */
71     void initPhotonScatterFuncs ();
72    
73     /* Find antimatter geometry declared as photon sensors */
74     void getPhotonSensors (char **sensorList);
75    
76     #endif