51 |
|
#endif |
52 |
|
extern OBJECT ambset [MAXASET+1]; |
53 |
|
|
54 |
+ |
/* Callback to print photon attributes acc. to user defined format */ |
55 |
+ |
int (*printPhoton)(RAY *r, Photon *p, PhotonMap *pm); |
56 |
|
|
57 |
|
|
58 |
+ |
|
59 |
|
void initPhotonMap (PhotonMap *pmap, PhotonMapType t) |
60 |
|
/* Init photon map 'n' stuff... */ |
61 |
|
{ |
238 |
|
} |
239 |
|
|
240 |
|
/* Adjust flux according to distribution ratio and ray weight */ |
241 |
< |
copycolor(photonFlux, ray -> rcol); |
241 |
> |
copycolor(photonFlux, ray -> rcol); |
242 |
> |
#if 0 |
243 |
> |
/* Factored out ray -> rweight as deprecated (?) for pmap, and infact |
244 |
> |
erroneously attenuates volume photon flux based on extinction, |
245 |
> |
which is already factored in by photonParticipate() */ |
246 |
|
scalecolor(photonFlux, |
247 |
|
ray -> rweight / (pmap -> distribRatio ? pmap -> distribRatio |
248 |
|
: 1)); |
249 |
+ |
#else |
250 |
+ |
scalecolor(photonFlux, |
251 |
+ |
1.0 / (pmap -> distribRatio ? pmap -> distribRatio : 1)); |
252 |
+ |
#endif |
253 |
|
setPhotonFlux(&photon, photonFlux); |
254 |
|
|
255 |
|
/* Set photon position and flags */ |
298 |
|
flushPhotonHeap(pmap); |
299 |
|
|
300 |
|
pmap -> numPhotons++; |
301 |
+ |
|
302 |
+ |
/* Print photon attributes */ |
303 |
+ |
if (printPhoton) |
304 |
+ |
/* Non-const kludge */ |
305 |
+ |
printPhoton((RAY*)ray, &photon, pmap); |
306 |
|
|
307 |
|
return 0; |
308 |
|
} |