157 |
|
return(ok); |
158 |
|
baderror: |
159 |
|
objerror(ndp->mp, USER, transSDError(ec)); |
160 |
+ |
return(0); /* gratis return */ |
161 |
|
} |
162 |
|
|
163 |
|
/* Compute source contribution for BSDF (reflected & transmitted) */ |
515 |
|
} |
516 |
|
if (!ec) |
517 |
|
ec = SDinvXform(nd.fromloc, nd.toloc); |
517 |
– |
/* determine BSDF resolution */ |
518 |
– |
if (!ec) |
519 |
– |
ec = SDsizeBSDF(nd.sr_vpsa, nd.vray, NULL, |
520 |
– |
SDqueryMin+SDqueryMax, nd.sd); |
518 |
|
if (ec) { |
519 |
< |
objerror(m, WARNING, transSDError(ec)); |
523 |
< |
SDfreeCache(nd.sd); |
519 |
> |
objerror(m, WARNING, "Illegal orientation vector"); |
520 |
|
return(1); |
521 |
|
} |
522 |
+ |
/* determine BSDF resolution */ |
523 |
+ |
ec = SDsizeBSDF(nd.sr_vpsa, nd.vray, NULL, SDqueryMin+SDqueryMax, nd.sd); |
524 |
+ |
if (ec) |
525 |
+ |
objerror(m, USER, transSDError(ec)); |
526 |
+ |
|
527 |
|
nd.sr_vpsa[0] = sqrt(nd.sr_vpsa[0]); |
528 |
|
nd.sr_vpsa[1] = sqrt(nd.sr_vpsa[1]); |
529 |
|
if (!hitfront) { /* perturb normal towards hit */ |
557 |
|
bnorm[2] = -nd.pnorm[2]; |
558 |
|
if (nd.thick != 0) { /* proxy with offset? */ |
559 |
|
VCOPY(vtmp, r->rop); |
560 |
< |
VSUM(r->rop, vtmp, r->ron, -nd.thick); |
560 |
> |
VSUM(r->rop, vtmp, r->ron, nd.thick); |
561 |
|
multambient(ctmp, r, bnorm); |
562 |
|
VCOPY(r->rop, vtmp); |
563 |
|
} else |