ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/m_mirror.c
(Generate patch)

Comparing ray/src/rt/m_mirror.c (file contents):
Revision 2.17 by greg, Tue Feb 24 19:39:26 2015 UTC vs.
Revision 2.21 by greg, Fri Apr 19 19:01:32 2019 UTC

# Line 11 | Line 11 | static const char      RCSid[] = "$Id$";
11   #include  "otypes.h"
12   #include  "rtotypes.h"
13   #include  "source.h"
14 #include  "pmapmat.h"
14  
15   /*
16   * The real arguments for MAT_MIRROR are simply:
# Line 40 | Line 39 | m_mirror(                      /* shade mirrored ray */
39          RAY  nr;
40          int  rpure = 1;
41          int  i;
43        
44        /* PMAP: skip specular refl via ambient bounce if already accounted for
45         * in photon map */
46        if (ambRayInPmap(r))
47                return(1);
42                                          /* check arguments */
43          if (m->oargs.nfargs != 3 || m->oargs.nsargs > 1)
44                  objerror(m, USER, "bad number of arguments");
45                                          /* check for substitute material */
46                                          /* but avoid double-counting */
47 <        if (m->oargs.nsargs > 0 && !(r->crtype & (AMBIENT|SPECULAR)) &&
48 <                        (r->rsrc < 0 || source[r->rsrc].so != r->ro)) {
47 >        if ( m->oargs.nsargs > 0 &&
48 >                        (r->rsrc < 0 || source[r->rsrc].so != r->ro) &&
49 >                        !(r->crtype & (AMBIENT|SPECULAR) && r->rod > 0.) ) {
50                  if (!strcmp(m->oargs.sarg[0], VOIDID)) {
51                          raytrans(r);
52                          return(1);
# Line 103 | Line 98 | m_mirror(                      /* shade mirrored ray */
98          checknorm(nr.rdir);
99          rayvalue(&nr);
100          multcolor(nr.rcol, nr.rcoef);
101 +        copycolor(r->mcol, nr.rcol);
102          addcolor(r->rcol, nr.rcol);
103 +        r->rmt = r->rot;
104          if (rpure && r->ro != NULL && isflat(r->ro->otype))
105 <                r->rt = r->rot + nr.rt;
105 >                r->rmt += r->rot + raydistance(&nr);
106          return(1);
107   }
108  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines