239 |
|
if (!(nd.specfl & SP_PURE) && |
240 |
|
specthresh >= nd.tspec-FTINY) |
241 |
|
nd.specfl |= SP_TBLT; |
242 |
< |
if (!hastexture || r->crtype & SHADOW) { |
242 |
> |
if (!hastexture || r->crtype & (SHADOW|AMBIENT)) { |
243 |
|
VCOPY(nd.prdir, r->rdir); |
244 |
|
transtest = 2; |
245 |
|
} else { |
306 |
|
rayvalue(&lr); |
307 |
|
multcolor(lr.rcol, lr.rcoef); |
308 |
|
addcolor(r->rcol, lr.rcol); |
309 |
< |
if (!hastexture && nd.specfl & SP_FLAT) { |
309 |
> |
if (nd.specfl & SP_FLAT && |
310 |
> |
!hastexture | (r->crtype & AMBIENT)) { |
311 |
|
mirtest = 2.*bright(lr.rcol); |
312 |
|
mirdist = r->rot + lr.rt; |
313 |
|
} |
378 |
|
(np->specfl & (SP_TRAN|SP_TBLT)) != SP_TRAN) |
379 |
|
return; |
380 |
|
/* set up sample coordinates */ |
381 |
< |
v[0] = v[1] = v[2] = 0.0; |
381 |
< |
for (i = 0; i < 3; i++) |
382 |
< |
if (np->pnorm[i] < 0.6 && np->pnorm[i] > -0.6) |
383 |
< |
break; |
384 |
< |
v[i] = 1.0; |
385 |
< |
fcross(u, v, np->pnorm); |
386 |
< |
normalize(u); |
381 |
> |
getperpendicular(u, np->pnorm); |
382 |
|
fcross(v, np->pnorm, u); |
383 |
|
/* compute reflection */ |
384 |
|
if ((np->specfl & (SP_REFL|SP_RBLT)) == SP_REFL && |