ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/m_brdf.c
(Generate patch)

Comparing ray/src/rt/m_brdf.c (file contents):
Revision 1.9 by greg, Thu Jun 13 13:58:16 1991 UTC vs.
Revision 1.10 by greg, Mon Jun 17 08:53:58 1991 UTC

# Line 122 | Line 122 | double  omega;                 /* light source size */
122          if (ldot > 0.0 ? np->rspec <= FTINY : np->tspec <= FTINY)
123                  return;         /* no specular component */
124                                          /* set up function */
125 <        setfunc(np->mp, np->pr);
125 >        setbrdfunc(np);
126          sa = np->mp->oargs.sarg;
127          errno = 0;
128                                          /* transform light vector */
# Line 192 | Line 192 | register RAY  *r;
192          double  transtest, transdist;
193          COLOR  ctmp;
194          double  dtmp;
195        FVECT  vec;
195          register int  i;
196                                                  /* check arguments */
197          switch (m->otype) {
# Line 259 | Line 258 | register RAY  *r;
258                          loadfunc(m->oargs.sarg[1]);
259          }
260                                                  /* set special variables */
261 <        setfunc(m, r);
263 <        multv3(vec, nd.pnorm, funcxf.xfm);
264 <        varset("NxP", '=', vec[0]/funcxf.sca);
265 <        varset("NyP", '=', vec[1]/funcxf.sca);
266 <        varset("NzP", '=', vec[2]/funcxf.sca);
267 <        varset("RdotP", '=', nd.pdot);
268 <        varset("CrP", '=', colval(nd.mcolor,RED));
269 <        varset("CgP", '=', colval(nd.mcolor,GRN));
270 <        varset("CbP", '=', colval(nd.mcolor,BLU));
261 >        setbrdfunc(&nd);
262                                                  /* compute transmitted ray */
263          if (m->otype == MAT_BRTDF && nd.tspec > FTINY) {
264                  RAY  sr;
# Line 344 | Line 335 | register RAY  *r;
335                                                  /* check distance */
336          if (transtest > bright(r->rcol))
337                  r->rt = transdist;
338 + }
339 +
340 +
341 + setbrdfunc(np)                  /* set up brdf function and variables */
342 + register BRDFDAT  *np;
343 + {
344 +        FVECT  vec;
345 +
346 +        if (setfunc(np->mp, np->pr) == 0)
347 +                return(0);      /* it's OK, setfunc says we're done */
348 +                                /* else (re)assign special variables */
349 +        multv3(vec, np->pnorm, funcxf.xfm);
350 +        varset("NxP", '=', vec[0]/funcxf.sca);
351 +        varset("NyP", '=', vec[1]/funcxf.sca);
352 +        varset("NzP", '=', vec[2]/funcxf.sca);
353 +        varset("RdotP", '=', np->pdot);
354 +        varset("CrP", '=', colval(np->mcolor,RED));
355 +        varset("CgP", '=', colval(np->mcolor,GRN));
356 +        varset("CbP", '=', colval(np->mcolor,BLU));
357 +        return(1);
358   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines