232 |
|
} else |
233 |
|
nd.tdiff = nd.tspec = nd.trans = 0.0; |
234 |
|
/* transmitted ray */ |
235 |
< |
if ((nd.specfl&(SP_TRAN|SP_PURE)) == (SP_TRAN|SP_PURE)) { |
235 |
> |
if ((nd.specfl&(SP_TRAN|SP_PURE|SP_TBLT)) == (SP_TRAN|SP_PURE)) { |
236 |
|
RAY lr; |
237 |
|
if (rayorigin(&lr, r, TRANS, nd.tspec) == 0) { |
238 |
|
VCOPY(lr.rdir, nd.prdir); |
269 |
|
if (hastexture && DOT(nd.vrefl, r->ron) <= FTINY) |
270 |
|
for (i = 0; i < 3; i++) /* safety measure */ |
271 |
|
nd.vrefl[i] = r->rdir[i] + 2.*r->rod*r->ron[i]; |
272 |
< |
|
273 |
< |
if (!(r->crtype & SHADOW) && nd.specfl & SP_PURE) { |
274 |
< |
RAY lr; |
275 |
< |
if (rayorigin(&lr, r, REFLECTED, nd.rspec) == 0) { |
276 |
< |
VCOPY(lr.rdir, nd.vrefl); |
277 |
< |
rayvalue(&lr); |
278 |
< |
multcolor(lr.rcol, nd.scolor); |
279 |
< |
addcolor(r->rcol, lr.rcol); |
280 |
< |
if (!hastexture && nd.specfl & SP_FLAT) { |
281 |
< |
mirtest = 2.*bright(lr.rcol); |
282 |
< |
mirdist = r->rot + lr.rt; |
283 |
< |
} |
272 |
> |
} |
273 |
> |
/* reflected ray */ |
274 |
> |
if ((nd.specfl&(SP_REFL|SP_PURE|SP_RBLT)) == (SP_REFL|SP_PURE)) { |
275 |
> |
RAY lr; |
276 |
> |
if (rayorigin(&lr, r, REFLECTED, nd.rspec) == 0) { |
277 |
> |
VCOPY(lr.rdir, nd.vrefl); |
278 |
> |
rayvalue(&lr); |
279 |
> |
multcolor(lr.rcol, nd.scolor); |
280 |
> |
addcolor(r->rcol, lr.rcol); |
281 |
> |
if (!hastexture && nd.specfl & SP_FLAT) { |
282 |
> |
mirtest = 2.*bright(lr.rcol); |
283 |
> |
mirdist = r->rot + lr.rt; |
284 |
|
} |
285 |
|
} |
286 |
|
} |
290 |
|
if (nd.specfl & SP_PURE && nd.rdiff <= FTINY && nd.tdiff <= FTINY) |
291 |
|
return(1); /* 100% pure specular */ |
292 |
|
|
293 |
< |
if (nd.specfl & (SP_REFL|SP_TRAN) && !(nd.specfl & SP_PURE)) |
294 |
< |
gaussamp(r, &nd); |
293 |
> |
if (!(nd.specfl & SP_PURE)) |
294 |
> |
gaussamp(r, &nd); /* checks *BLT flags */ |
295 |
|
|
296 |
|
if (nd.rdiff > FTINY) { /* ambient from this side */ |
297 |
|
ambient(ctmp, r, hastexture?nd.pnorm:r->ron); |