246 |
|
break; |
247 |
|
if (i-3 != nd.dp->nd) |
248 |
|
objerror(m, USER, "dimension error"); |
249 |
< |
if (!fundefined(m->oargs.sarg[3])) |
250 |
< |
loadfunc(m->oargs.sarg[2]); |
249 |
> |
funcfile(m->oargs.sarg[2]); |
250 |
|
} else if (m->otype == MAT_BRTDF) { |
251 |
|
nd.dp = NULL; |
252 |
< |
if (!fundefined(m->oargs.sarg[7])) |
254 |
< |
loadfunc(m->oargs.sarg[9]); |
252 |
> |
funcfile(m->oargs.sarg[9]); |
253 |
|
} else { |
254 |
|
nd.dp = NULL; |
255 |
< |
if (!fundefined(m->oargs.sarg[0])) |
258 |
< |
loadfunc(m->oargs.sarg[1]); |
255 |
> |
funcfile(m->oargs.sarg[1]); |
256 |
|
} |
257 |
|
/* set special variables */ |
258 |
|
setbrdfunc(&nd); |
264 |
|
setcolor(ctmp, varvalue(m->oargs.sarg[3]), |
265 |
|
varvalue(m->oargs.sarg[4]), |
266 |
|
varvalue(m->oargs.sarg[5])); |
267 |
< |
scalecolor(ctmp, nd.tspec); |
267 |
> |
scalecolor(ctmp, nd.trans); |
268 |
|
if (errno) |
269 |
|
objerror(m, WARNING, "compute error"); |
270 |
|
else if ((tspect = bright(ctmp)) > FTINY && |
271 |
|
rayorigin(&sr, r, TRANS, tspect) == 0) { |
272 |
< |
if (DOT(r->pert,r->pert) > FTINY*FTINY) { |
272 |
> |
if (!(r->crtype & SHADOW) && |
273 |
> |
DOT(r->pert,r->pert) > FTINY*FTINY) { |
274 |
|
for (i = 0; i < 3; i++) /* perturb direction */ |
275 |
|
sr.rdir[i] = r->rdir[i] - |
276 |
|
.75*r->pert[i]; |
296 |
|
setcolor(ctmp, varvalue(m->oargs.sarg[0]), |
297 |
|
varvalue(m->oargs.sarg[1]), |
298 |
|
varvalue(m->oargs.sarg[2])); |
301 |
– |
scalecolor(ctmp, nd.rspec); |
299 |
|
if (errno) |
300 |
|
objerror(m, WARNING, "compute error"); |
301 |
|
else if ((rspecr = bright(ctmp)) > FTINY && |