ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/pmapmat.h
Revision: 2.10
Committed: Wed Sep 2 18:59:01 2015 UTC (8 years, 8 months ago) by greg
Content type: text/plain
Branch: MAIN
CVS Tags: rad5R0
Changes since 2.9: +13 -9 lines
Log Message:
Had to reinstate ambRayInPmap() macro to avoid over-counting bug

File Contents

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