531 |
|
cvt_sdcolor(sr.rcoef, &bsv); /* use sample color */ |
532 |
|
if (xmit) /* apply pattern on transmit */ |
533 |
|
smultscolor(sr.rcoef, ndp->pr->pcol); |
534 |
< |
if (rayorigin(&sr, SPECULAR, ndp->pr, sr.rcoef) < 0) { |
534 |
> |
if (rayorigin(&sr, xmit ? TSPECULAR : RSPECULAR, ndp->pr, sr.rcoef) < 0) { |
535 |
|
if (!n & (nstarget > 1)) { |
536 |
|
n = nstarget; /* avoid infinitue loop */ |
537 |
|
nstarget = nstarget*sr.rweight/minweight; |
766 |
|
copyscolor(sctmp, nd.rdiff); |
767 |
|
saddscolor(sctmp, nd.runsamp); |
768 |
|
if (sintens(sctmp) > FTINY) { /* ambient from reflection */ |
769 |
– |
if (!hitfront) |
770 |
– |
flipsurface(r); |
769 |
|
multambient(sctmp, r, nd.pnorm); |
770 |
|
saddscolor(r->rcol, sctmp); |
773 |
– |
if (!hitfront) |
774 |
– |
flipsurface(r); |
771 |
|
} |
772 |
|
copyscolor(sctmp, nd.tdiff); |
773 |
|
saddscolor(sctmp, nd.tunsamp); |
774 |
|
if (sintens(sctmp) > FTINY) { /* ambient from other side */ |
775 |
|
FVECT bnorm; |
780 |
– |
if (hitfront) |
781 |
– |
flipsurface(r); |
776 |
|
bnorm[0] = -nd.pnorm[0]; |
777 |
|
bnorm[1] = -nd.pnorm[1]; |
778 |
|
bnorm[2] = -nd.pnorm[2]; |
784 |
|
} else |
785 |
|
multambient(sctmp, r, bnorm); |
786 |
|
saddscolor(r->rcol, sctmp); |
793 |
– |
if (hitfront) |
794 |
– |
flipsurface(r); |
787 |
|
} |
788 |
|
/* add direct component */ |
789 |
|
if ((nd.sd->tf == NULL) & (nd.sd->tb == NULL) && |