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.17 by greg, Mon Mar 3 00:10:51 2003 UTC vs.
Revision 2.20 by greg, Thu Aug 28 03:22:16 2003 UTC

# Line 9 | Line 9 | static const char      RCSid[] = "$Id$";
9  
10   #include  "ray.h"
11  
12 + #include  "ambient.h"
13 +
14   #include  "data.h"
15  
16   #include  "otypes.h"
# Line 160 | Line 162 | double  omega;                 /* light source size */
162                  dtmp = funvalue(sa[0], 5, vldx);
163                  setcolor(ctmp, dtmp, dtmp, dtmp);
164          }
165 <        if (errno) {
165 >        if (errno == EDOM || errno == ERANGE) {
166                  objerror(np->mp, WARNING, "compute error");
167                  return;
168          }
# Line 170 | Line 172 | double  omega;                 /* light source size */
172                  /*
173                   *  Compute reflected non-diffuse component.
174                   */
175 <                if (np->mp->otype == MAT_MFUNC | np->mp->otype == MAT_MDATA)
175 >                if ((np->mp->otype == MAT_MFUNC) | (np->mp->otype == MAT_MDATA))
176                          multcolor(ctmp, np->mcolor);
177                  dtmp = ldot * omega * np->rspec;
178                  scalecolor(ctmp, dtmp);
# Line 179 | Line 181 | double  omega;                 /* light source size */
181                  /*
182                   *  Compute transmitted non-diffuse component.
183                   */
184 <                if (np->mp->otype == MAT_TFUNC | np->mp->otype == MAT_TDATA)
184 >                if ((np->mp->otype == MAT_TFUNC) | (np->mp->otype == MAT_TDATA))
185                          multcolor(ctmp, np->mcolor);
186                  dtmp = -ldot * omega * np->tspec;
187                  scalecolor(ctmp, dtmp);
# Line 204 | Line 206 | register RAY  *r;
206          register MFUNC  *mf;
207          register int  i;
208                                                  /* check arguments */
209 <        if (m->oargs.nsargs < 10 | m->oargs.nfargs < 9)
209 >        if ((m->oargs.nsargs < 10) | (m->oargs.nfargs < 9))
210                  objerror(m, USER, "bad # arguments");
211          nd.mp = m;
212          nd.pr = r;
# Line 251 | Line 253 | register RAY  *r;
253          setcolor(ctmp, evalue(mf->ep[3]),
254                          evalue(mf->ep[4]),
255                          evalue(mf->ep[5]));
256 <        if (errno)
256 >        if (errno == EDOM || errno == ERANGE)
257                  objerror(m, WARNING, "compute error");
258          else if (rayorigin(&sr, r, TRANS, bright(ctmp)) == 0) {
259                  if (!(r->crtype & SHADOW) &&
# Line 280 | Line 282 | register RAY  *r;
282          setcolor(ctmp, evalue(mf->ep[0]),
283                          evalue(mf->ep[1]),
284                          evalue(mf->ep[2]));
285 <        if (errno)
285 >        if (errno == EDOM || errno == ERANGE)
286                  objerror(m, WARNING, "compute error");
287          else if (rayorigin(&sr, r, REFLECTED, bright(ctmp)) == 0) {
288                  for (i = 0; i < 3; i++)
# Line 335 | Line 337 | register RAY  *r;
337          if (r->crtype & SHADOW)
338                  return(1);
339                                                  /* check arguments */
340 <        if (m->oargs.nsargs < (hasdata(m->otype)?4:2) | m->oargs.nfargs <
341 <                        (m->otype==MAT_TFUNC|m->otype==MAT_TDATA?6:4))
340 >        if ((m->oargs.nsargs < (hasdata(m->otype)?4:2)) | (m->oargs.nfargs <
341 >                        ((m->otype==MAT_TFUNC)|(m->otype==MAT_TDATA)?6:4)))
342                  objerror(m, USER, "bad # arguments");
343                                                  /* check for back side */
344          if (r->rod < 0.0) {
# Line 359 | Line 361 | register RAY  *r;
361                                                  /* get specular component */
362          nd.rspec = m->oargs.farg[3];
363                                                  /* compute transmittance */
364 <        if (m->otype == MAT_TFUNC | m->otype == MAT_TDATA) {
364 >        if ((m->otype == MAT_TFUNC) | (m->otype == MAT_TDATA)) {
365                  nd.trans = m->oargs.farg[4]*(1.0 - nd.rspec);
366                  nd.tspec = nd.trans * m->oargs.farg[5];
367                  dtmp = nd.trans - nd.tspec;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines