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.30 by greg, Wed Aug 7 05:10:09 2013 UTC vs.
Revision 2.33 by greg, Wed Sep 2 18:59:01 2015 UTC

# Line 14 | Line 14 | static const char      RCSid[] = "$Id$";
14   #include  "otypes.h"
15   #include  "rtotypes.h"
16   #include  "func.h"
17 + #include  "pmapmat.h"
18  
19   /*
20   *      Arguments to this material include the color and specularity.
# Line 127 | Line 128 | dirbrdf(               /* compute source contribution */
128                  scalecolor(ctmp, dtmp);
129                  addcolor(cval, ctmp);
130          }
131 <        if (ldot > 0.0 ? np->rspec <= FTINY : np->tspec <= FTINY)
131 >        if ((ldot > 0.0 ? np->rspec <= FTINY : np->tspec <= FTINY) ||
132 >                        ambRayInPmap(np->pr))
133                  return;         /* diffuse only */
134                                          /* set up function */
135          setbrdfunc(np);
# Line 140 | Line 142 | dirbrdf(               /* compute source contribution */
142          lddx[3] = omega;
143                                          /* compute BRTDF */
144          if (np->mp->otype == MAT_BRTDF) {
145 <                if (sa[6][0] == '0')            /* special case */
145 >                if (sa[6][0] == '0' && !sa[6][1])       /* special case */
146                          colval(ctmp,RED) = 0.0;
147                  else
148                          colval(ctmp,RED) = funvalue(sa[6], 4, lddx);
149 <                if (sa[7][0] == '0')
149 >                if (sa[7][0] == '0' && !sa[7][1])
150                          colval(ctmp,GRN) = 0.0;
151                  else if (!strcmp(sa[7],sa[6]))
152                          colval(ctmp,GRN) = colval(ctmp,RED);
153                  else
154                          colval(ctmp,GRN) = funvalue(sa[7], 4, lddx);
155 <                if (!strcmp(sa[8],sa[6]))
155 >                if (sa[8][0] == '0' && !sa[8][1])
156 >                        colval(ctmp,BLU) = 0.0;
157 >                else if (!strcmp(sa[8],sa[6]))
158                          colval(ctmp,BLU) = colval(ctmp,RED);
159                  else if (!strcmp(sa[8],sa[7]))
160                          colval(ctmp,BLU) = colval(ctmp,GRN);
# Line 363 | Line 367 | m_brdf2(                       /* color a ray that hit a BRDF material */
367                  objerror(m, USER, "bad # arguments");
368                                                  /* check for back side */
369          if (r->rod < 0.0) {
370 <                if (!backvis && m->otype != MAT_TFUNC
367 <                                && m->otype != MAT_TDATA) {
370 >                if (!backvis) {
371                          raytrans(r);
372                          return(1);
373                  }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines