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.16 by greg, Tue Feb 25 02:47:22 2003 UTC vs.
Revision 2.18 by greg, Wed Mar 5 16:16:53 2003 UTC

# Line 160 | Line 160 | double  omega;                 /* light source size */
160                  dtmp = funvalue(sa[0], 5, vldx);
161                  setcolor(ctmp, dtmp, dtmp, dtmp);
162          }
163 <        if (errno) {
163 >        if (errno == EDOM || errno == ERANGE) {
164                  objerror(np->mp, WARNING, "compute error");
165                  return;
166          }
# Line 224 | Line 224 | register RAY  *r;
224          setcolor(nd.tdiff, m->oargs.farg[6],
225                          m->oargs.farg[7],
226                          m->oargs.farg[8]);
227 <                                        /* get modifiers */
227 >                                                /* get modifiers */
228          raytexture(r, m->omod);
229          nd.pdot = raynormal(nd.pnorm, r);       /* perturb normal */
230          if (r->rod < 0.0) {                     /* orient perturbed values */
# Line 251 | Line 251 | register RAY  *r;
251          setcolor(ctmp, evalue(mf->ep[3]),
252                          evalue(mf->ep[4]),
253                          evalue(mf->ep[5]));
254 <        if (errno)
254 >        if (errno == EDOM || errno == ERANGE)
255                  objerror(m, WARNING, "compute error");
256          else if (rayorigin(&sr, r, TRANS, bright(ctmp)) == 0) {
257                  if (!(r->crtype & SHADOW) &&
# Line 280 | Line 280 | register RAY  *r;
280          setcolor(ctmp, evalue(mf->ep[0]),
281                          evalue(mf->ep[1]),
282                          evalue(mf->ep[2]));
283 <        if (errno)
283 >        if (errno == EDOM || errno == ERANGE)
284                  objerror(m, WARNING, "compute error");
285          else if (rayorigin(&sr, r, REFLECTED, bright(ctmp)) == 0) {
286                  for (i = 0; i < 3; i++)
# Line 338 | Line 338 | register RAY  *r;
338          if (m->oargs.nsargs < (hasdata(m->otype)?4:2) | m->oargs.nfargs <
339                          (m->otype==MAT_TFUNC|m->otype==MAT_TDATA?6:4))
340                  objerror(m, USER, "bad # arguments");
341 +                                                /* check for back side */
342 +        if (r->rod < 0.0) {
343 +                if (!backvis && m->otype != MAT_TFUNC
344 +                                && m->otype != MAT_TDATA) {
345 +                        raytrans(r);
346 +                        return(1);
347 +                }
348 +                raytexture(r, m->omod);
349 +                flipsurface(r);                 /* reorient if backvis */
350 +        } else
351 +                raytexture(r, m->omod);
352 +
353          nd.mp = m;
354          nd.pr = r;
355                                                  /* get material color */
# Line 359 | Line 371 | register RAY  *r;
371                                                  /* compute reflectance */
372          dtmp = 1.0 - nd.trans - nd.rspec;
373          setcolor(nd.rdiff, dtmp, dtmp, dtmp);
362                                                /* check for back side */
363        if (r->rod < 0.0) {
364                if (!backvis && m->otype != MAT_TFUNC
365                                && m->otype != MAT_TDATA) {
366                        raytrans(r);
367                        return(1);
368                }
369                flipsurface(r);                 /* reorient if backvis */
370        }
371                                                /* get modifiers */
372        raytexture(r, m->omod);
374          nd.pdot = raynormal(nd.pnorm, r);       /* perturb normal */
375          multcolor(nd.mcolor, r->pcol);          /* modify material color */
376          multcolor(nd.rdiff, nd.mcolor);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines