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.28 by greg, Sun Jul 29 21:56:16 2012 UTC vs.
Revision 2.32 by greg, Thu Aug 6 16:06:06 2015 UTC

# Line 38 | Line 38 | static const char      RCSid[] = "$Id$";
38   *  Arguments for MAT_TFUNC are:
39   *      2+      func    funcfile        transform
40   *      0
41 < *      4+      red     grn     blu     rspec   trans   tspec   A7 ..
41 > *      6+      red     grn     blu     rspec   trans   tspec   A7 ..
42   *
43   *  Arguments for MAT_TDATA are:
44   *      4+      func    datafile        funcfile        v0 ..   transform
45   *      0
46 < *      4+      red     grn     blu     rspec   trans   tspec   A7 ..
46 > *      6+      red     grn     blu     rspec   trans   tspec   A7 ..
47   *
48   *  Arguments for the more general MAT_BRTDF are:
49   *      10+     rrefl   grefl   brefl
# Line 140 | Line 140 | dirbrdf(               /* compute source contribution */
140          lddx[3] = omega;
141                                          /* compute BRTDF */
142          if (np->mp->otype == MAT_BRTDF) {
143 <                if (sa[6][0] == '0')            /* special case */
143 >                if (sa[6][0] == '0' && !sa[6][1])       /* special case */
144                          colval(ctmp,RED) = 0.0;
145                  else
146                          colval(ctmp,RED) = funvalue(sa[6], 4, lddx);
147 <                if (sa[7][0] == '0')
147 >                if (sa[7][0] == '0' && !sa[7][1])
148                          colval(ctmp,GRN) = 0.0;
149                  else if (!strcmp(sa[7],sa[6]))
150                          colval(ctmp,GRN) = colval(ctmp,RED);
151                  else
152                          colval(ctmp,GRN) = funvalue(sa[7], 4, lddx);
153 <                if (!strcmp(sa[8],sa[6]))
153 >                if (sa[8][0] == '0' && !sa[8][1])
154 >                        colval(ctmp,BLU) = 0.0;
155 >                else if (!strcmp(sa[8],sa[6]))
156                          colval(ctmp,BLU) = colval(ctmp,RED);
157                  else if (!strcmp(sa[8],sa[7]))
158                          colval(ctmp,BLU) = colval(ctmp,GRN);
# Line 206 | Line 208 | m_brdf(                        /* color a ray that hit a BRDTfunc material
208          BRDFDAT  nd;
209          RAY  sr;
210          double  mirtest=0, mirdist=0;
211 <        double  transtest, transdist;
211 >        double  transtest=0, transdist=0;
212          int  hasrefl, hastrans;
213          int  hastexture;
214          COLOR  ctmp;
# Line 363 | Line 365 | m_brdf2(                       /* color a ray that hit a BRDF material */
365                  objerror(m, USER, "bad # arguments");
366                                                  /* check for back side */
367          if (r->rod < 0.0) {
368 <                if (!backvis && m->otype != MAT_TFUNC
367 <                                && m->otype != MAT_TDATA) {
368 >                if (!backvis) {
369                          raytrans(r);
370                          return(1);
371                  }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines