ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/pmapmat.h
Revision: 2.8
Committed: Tue Aug 18 18:45:55 2015 UTC (8 years, 9 months ago) by greg
Content type: text/plain
Branch: MAIN
Changes since 2.7: +2 -1 lines
Log Message:
Added missing RCSid forgotten during initial check-in

File Contents

# Content
1 /* RCSid $Id$ */
2 /*
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 (c) Lucerne University of Applied Sciences and Arts,
9 supported by the Swiss National Science Foundation (SNSF, #147053)
10 ==================================================================
11
12 $Id: pmapmat.h,v 2.7 2015/07/29 18:54:20 rschregle Exp $
13 */
14
15
16 #ifndef PMAPMAT_H
17 #define PMAPMAT_H
18
19 #include "pmap.h"
20
21 /*
22 Check for paths already accounted for in photon map to avoid
23 double-counting during backward raytracing.
24
25 shadowRayInPmap(): Check for DIFFUSE -> SPECULAR -> LIGHT
26 subpaths. These occur during the backward pass
27 when a shadow ray is transferred through a
28 transparent material. These subpaths are already
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 (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)
45
46
47 /* Scattered photon ray types for photonRay() */
48 #define PMAP_DIFFREFL (REFLECTED | AMBIENT)
49 #define PMAP_DIFFTRANS (REFLECTED | AMBIENT | TRANS)
50 #define PMAP_SPECREFL (REFLECTED | SPECULAR)
51 #define PMAP_SPECTRANS (REFLECTED | SPECULAR | TRANS)
52 #define PMAP_REFRACT (REFRACTED | SPECULAR)
53 #define PMAP_XFER (TRANS)
54
55
56
57 /* Dispatch table for photon scattering functions */
58 extern int (*photonScatter []) (OBJREC*, RAY*);
59
60 /* List of antimatter sensor modifier names */
61 extern char *photonSensorList [MAXSET + 1];
62
63
64
65 /* Spawn a new photon ray from a previous one; this is effectively a
66 * customised rayorigin(). */
67 void photonRay (const RAY *rayIn, RAY *rayOut, int rayOutType,
68 COLOR fluxAtten);
69
70 /* Init photonScatter[] dispatch table with material specific scattering
71 routines */
72 void initPhotonScatterFuncs ();
73
74 /* Find antimatter geometry declared as photon sensors */
75 void getPhotonSensors (char **sensorList);
76
77 #endif