123 |
|
addcolor(cval, ctmp); |
124 |
|
} |
125 |
|
|
126 |
– |
/* PMAP: skip direct specular via ambient bounce if already accounted for |
127 |
– |
* in photon map */ |
128 |
– |
if (ambRayInPmap(np->rp)) |
129 |
– |
return; |
130 |
– |
|
126 |
|
if (ldot > FTINY && (np->specfl&(SP_REFL|SP_PURE)) == SP_REFL) { |
127 |
|
/* |
128 |
|
* Compute specular reflection coefficient using |
264 |
|
nd.tdiff = nd.tspec = nd.trans = 0.0; |
265 |
|
/* transmitted ray */ |
266 |
|
|
267 |
< |
/* PMAP: skip indirect specular trans via ambient bounce if already |
273 |
< |
* accounted for in photon map */ |
274 |
< |
if (!ambRayInPmap(r) && |
275 |
< |
(nd.specfl&(SP_TRAN|SP_PURE|SP_TBLT)) == (SP_TRAN|SP_PURE)) { |
267 |
> |
if ((nd.specfl&(SP_TRAN|SP_PURE|SP_TBLT)) == (SP_TRAN|SP_PURE)) { |
268 |
|
RAY lr; |
269 |
|
copycolor(lr.rcoef, nd.mcolor); /* modified by color */ |
270 |
|
scalecolor(lr.rcoef, nd.tspec); |
309 |
|
checknorm(nd.vrefl); |
310 |
|
} |
311 |
|
/* reflected ray */ |
312 |
< |
/* PMAP: skip indirect specular refl via ambient ray if already accounted |
321 |
< |
* for in photon map */ |
322 |
< |
if (!ambRayInPmap(r) && |
323 |
< |
(nd.specfl&(SP_REFL|SP_PURE|SP_RBLT)) == (SP_REFL|SP_PURE)) { |
312 |
> |
if ((nd.specfl&(SP_REFL|SP_PURE|SP_RBLT)) == (SP_REFL|SP_PURE)) { |
313 |
|
RAY lr; |
314 |
|
if (rayorigin(&lr, REFLECTED, r, nd.scolor) == 0) { |
315 |
|
VCOPY(lr.rdir, nd.vrefl); |
329 |
|
if (nd.specfl & SP_PURE && nd.rdiff <= FTINY && nd.tdiff <= FTINY) |
330 |
|
return(1); /* 100% pure specular */ |
331 |
|
|
332 |
< |
/* PMAP: skip indirect gaussian via ambient bounce if already accounted |
333 |
< |
* for in photon map */ |
345 |
< |
if (!ambRayInPmap(r)) |
346 |
< |
if (!(nd.specfl & SP_PURE)) |
347 |
< |
gaussamp(&nd); /* checks *BLT flags */ |
332 |
> |
if (!(nd.specfl & SP_PURE)) |
333 |
> |
gaussamp(&nd); /* checks *BLT flags */ |
334 |
|
|
335 |
|
if (nd.rdiff > FTINY) { /* ambient from this side */ |
336 |
|
copycolor(ctmp, nd.mcolor); /* modified by material color */ |