--- ray/src/rt/m_brdf.c 1991/07/10 09:35:26 1.13 +++ ray/src/rt/m_brdf.c 1991/11/12 17:09:08 2.1 @@ -246,16 +246,13 @@ register RAY *r; break; if (i-3 != nd.dp->nd) objerror(m, USER, "dimension error"); - if (!fundefined(m->oargs.sarg[3])) - loadfunc(m->oargs.sarg[2]); + funcfile(m->oargs.sarg[2]); } else if (m->otype == MAT_BRTDF) { nd.dp = NULL; - if (!fundefined(m->oargs.sarg[7])) - loadfunc(m->oargs.sarg[9]); + funcfile(m->oargs.sarg[9]); } else { nd.dp = NULL; - if (!fundefined(m->oargs.sarg[0])) - loadfunc(m->oargs.sarg[1]); + funcfile(m->oargs.sarg[1]); } /* set special variables */ setbrdfunc(&nd); @@ -267,12 +264,13 @@ register RAY *r; setcolor(ctmp, varvalue(m->oargs.sarg[3]), varvalue(m->oargs.sarg[4]), varvalue(m->oargs.sarg[5])); - scalecolor(ctmp, nd.tspec); + scalecolor(ctmp, nd.trans); if (errno) objerror(m, WARNING, "compute error"); else if ((tspect = bright(ctmp)) > FTINY && rayorigin(&sr, r, TRANS, tspect) == 0) { - if (DOT(r->pert,r->pert) > FTINY*FTINY) { + if (!(r->crtype & SHADOW) && + DOT(r->pert,r->pert) > FTINY*FTINY) { for (i = 0; i < 3; i++) /* perturb direction */ sr.rdir[i] = r->rdir[i] - .75*r->pert[i]; @@ -298,7 +296,6 @@ register RAY *r; setcolor(ctmp, varvalue(m->oargs.sarg[0]), varvalue(m->oargs.sarg[1]), varvalue(m->oargs.sarg[2])); - scalecolor(ctmp, nd.rspec); if (errno) objerror(m, WARNING, "compute error"); else if ((rspecr = bright(ctmp)) > FTINY &&