284 |
|
rayvalue(&sr); |
285 |
|
multcolor(sr.rcol, sr.rcoef); |
286 |
|
addcolor(r->rcol, sr.rcol); |
287 |
< |
if (!hastexture || r->crtype & (SHADOW|AMBIENT)) |
287 |
> |
if ((!hastexture || r->crtype & (SHADOW|AMBIENT)) && |
288 |
> |
nd.tspec > bright(nd.tdiff) + bright(nd.rdiff)) |
289 |
|
r->rxt = r->rot + raydistance(&sr); |
290 |
|
} |
291 |
|
if (r->crtype & SHADOW) /* the rest is shadow */ |
408 |
|
multambient(ctmp, r, nd.pnorm); |
409 |
|
addcolor(r->rcol, ctmp); /* add to returned color */ |
410 |
|
} |
411 |
< |
if (nd.trans > FTINY) { /* from other side */ |
411 |
> |
if (nd.trans > FTINY) { /* from other side */ |
412 |
|
flipsurface(r); |
413 |
|
vtmp[0] = -nd.pnorm[0]; |
414 |
|
vtmp[1] = -nd.pnorm[1]; |
437 |
|
return(0); /* it's OK, setfunc says we're done */ |
438 |
|
/* else (re)assign special variables */ |
439 |
|
multv3(vec, np->pnorm, funcxf.xfm); |
440 |
< |
varset("NxP", '=', vec[0]/funcxf.sca); |
441 |
< |
varset("NyP", '=', vec[1]/funcxf.sca); |
442 |
< |
varset("NzP", '=', vec[2]/funcxf.sca); |
443 |
< |
varset("RdotP", '=', np->pdot <= -1.0 ? -1.0 : |
440 |
> |
varset("NxP`", '=', vec[0]/funcxf.sca); |
441 |
> |
varset("NyP`", '=', vec[1]/funcxf.sca); |
442 |
> |
varset("NzP`", '=', vec[2]/funcxf.sca); |
443 |
> |
varset("RdotP`", '=', np->pdot <= -1.0 ? -1.0 : |
444 |
|
np->pdot >= 1.0 ? 1.0 : np->pdot); |
445 |
|
varset("CrP", '=', colval(np->mcolor,RED)); |
446 |
|
varset("CgP", '=', colval(np->mcolor,GRN)); |