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 2.6 by greg, Thu May 27 15:28:01 1993 UTC vs.
Revision 2.10 by greg, Wed Jan 12 16:46:35 1994 UTC

# Line 21 | Line 21 | static char SCCSid[] = "$SunId$ LBL";
21   *  String arguments include the reflection function and files.
22   *  The BRDF is currently used just for the specular component to light
23   *  sources.  Reflectance values or data coordinates are functions
24 < *  of the direction to the light source.
24 > *  of the direction to the light source.  (Data modification functions
25 > *  are passed the source direction as args 2-4.)
26   *      We orient the surface towards the incoming ray, so a single
27   *  surface can be used to represent an infinitely thin object.
28   *
# Line 88 | Line 89 | double  omega;                 /* light source size */
89          COLOR  ctmp;
90          FVECT  ldx;
91          double  lddx[3], pt[MAXDIM];
92 +        double  vldx[4];
93          register char   **sa;
94          register int    i;
95  
# Line 153 | Line 155 | double  omega;                 /* light source size */
155          } else {
156                  for (i = 0; i < np->dp->nd; i++)
157                          pt[i] = funvalue(sa[3+i], 3, lddx);
158 <                dtmp = datavalue(np->dp, pt);
159 <                dtmp = funvalue(sa[0], 1, &dtmp);
158 >                vldx[0] = datavalue(np->dp, pt);
159 >                vldx[1] = lddx[0]; vldx[2] = lddx[1]; vldx[3] = lddx[2];
160 >                dtmp = funvalue(sa[0], 4, vldx);
161                  setcolor(ctmp, dtmp, dtmp, dtmp);
162          }
163          if (errno) {
# Line 194 | Line 197 | register RAY  *r;
197          double  transtest, transdist;
198          int  hasrefl, hastrans;
199          COLOR  ctmp;
197        double  dtmp;
200          register MFUNC  *mf;
201          register int  i;
202                                                  /* check arguments */
# Line 239 | Line 241 | register RAY  *r;
241                                                  /* compute transmitted ray */
242          setbrdfunc(&nd);
243          transtest = 0;
244 +        transdist = r->rot;
245          errno = 0;
246          setcolor(ctmp, evalue(mf->ep[3]),
247                          evalue(mf->ep[4]),
# Line 265 | Line 268 | register RAY  *r;
268                  transdist = r->rot + sr.rt;
269          }
270          if (r->crtype & SHADOW)                 /* the rest is shadow */
271 <                return;
271 >                return(1);
272                                                  /* compute reflected ray */
273          setbrdfunc(&nd);
274          errno = 0;
# Line 305 | Line 308 | register RAY  *r;
308                                                  /* check distance */
309          if (transtest > bright(r->rcol))
310                  r->rt = transdist;
311 +
312 +        return(1);
313   }
314  
315  
# Line 318 | Line 323 | register RAY  *r;
323          double  dtmp;
324                                                  /* always a shadow */
325          if (r->crtype & SHADOW)
326 <                return;
326 >                return(1);
327                                                  /* check arguments */
328          if (m->oargs.nsargs < (hasdata(m->otype)?4:2) | m->oargs.nfargs <
329                          (m->otype==MAT_TFUNC|m->otype==MAT_TDATA?6:4))
# Line 378 | Line 383 | register RAY  *r;
383          }
384                                                  /* add direct component */
385          direct(r, dirbrdf, &nd);
386 +
387 +        return(1);
388   }
389  
390  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines