112 |
|
scalecolor(ctmp, dtmp); |
113 |
|
addcolor(cval, ctmp); |
114 |
|
} |
115 |
< |
|
115 |
> |
|
116 |
|
if (ldot < -FTINY && ltdiff > FTINY) { |
117 |
|
/* |
118 |
|
* Compute diffuse transmission. |
122 |
|
scalecolor(ctmp, dtmp); |
123 |
|
addcolor(cval, ctmp); |
124 |
|
} |
125 |
< |
|
126 |
< |
/* PMAP: skip direct specular via ambient bounce if already accounted for |
127 |
< |
* in photon map */ |
125 |
> |
|
126 |
|
if (ambRayInPmap(np->rp)) |
127 |
< |
return; |
127 |
> |
return; /* specular already in photon map */ |
128 |
|
|
129 |
|
if (ldot > FTINY && (np->specfl&(SP_REFL|SP_PURE)) == SP_REFL) { |
130 |
|
/* |
267 |
|
nd.tdiff = nd.tspec = nd.trans = 0.0; |
268 |
|
/* transmitted ray */ |
269 |
|
|
270 |
< |
/* 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)) { |
270 |
> |
if ((nd.specfl&(SP_TRAN|SP_PURE|SP_TBLT)) == (SP_TRAN|SP_PURE)) { |
271 |
|
RAY lr; |
272 |
|
copycolor(lr.rcoef, nd.mcolor); /* modified by color */ |
273 |
|
scalecolor(lr.rcoef, nd.tspec); |
312 |
|
checknorm(nd.vrefl); |
313 |
|
} |
314 |
|
/* reflected ray */ |
315 |
< |
/* 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)) { |
315 |
> |
if ((nd.specfl&(SP_REFL|SP_PURE|SP_RBLT)) == (SP_REFL|SP_PURE)) { |
316 |
|
RAY lr; |
317 |
|
if (rayorigin(&lr, REFLECTED, r, nd.scolor) == 0) { |
318 |
|
VCOPY(lr.rdir, nd.vrefl); |
332 |
|
if (nd.specfl & SP_PURE && nd.rdiff <= FTINY && nd.tdiff <= FTINY) |
333 |
|
return(1); /* 100% pure specular */ |
334 |
|
|
335 |
< |
/* PMAP: skip indirect gaussian via ambient bounce if already accounted |
336 |
< |
* for in photon map */ |
345 |
< |
if (!ambRayInPmap(r)) |
346 |
< |
if (!(nd.specfl & SP_PURE)) |
347 |
< |
gaussamp(&nd); /* checks *BLT flags */ |
335 |
> |
if (!(nd.specfl & SP_PURE)) |
336 |
> |
gaussamp(&nd); /* checks *BLT flags */ |
337 |
|
|
338 |
|
if (nd.rdiff > FTINY) { /* ambient from this side */ |
339 |
|
copycolor(ctmp, nd.mcolor); /* modified by material color */ |