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

Comparing ray/src/gen/mkillum2.c (file contents):
Revision 2.31 by greg, Fri Jun 12 17:37:37 2009 UTC vs.
Revision 2.33 by greg, Tue Sep 8 23:05:47 2009 UTC

# Line 13 | Line 13 | static const char      RCSid[] = "$Id$";
13   #include  "source.h"
14  
15   #ifndef NBSDFSAMPS
16 < #define NBSDFSAMPS      32              /* BSDF resampling count */
16 > #define NBSDFSAMPS      256             /* BSDF resampling count */
17   #endif
18  
19   COLORV *        distarr = NULL;         /* distribution array */
# Line 725 | Line 725 | redistribute(          /* pass distarr ray sums through BSDF *
725                          cp = &direct_discount[3*i];
726                          copycolor(cdir, cp);
727                          scalecolor(cdir, -wt);
728 <                        direct_out = flatindex(dv, nalt, nazi);
728 >                        if (b->nout != b->ninc)
729 >                                direct_out = flatindex(dv, nalt, nazi);
730 >                        else
731 >                                direct_out = i; /* assumes dist. mirroring */
732                  }
733                  for (k = nalt; k--; )           /* loop over distribution */
734                    for (j = nazi; j--; ) {
# Line 744 | Line 747 | redistribute(          /* pass distarr ray sums through BSDF *
747                          }
748                          wt = BSDF_value(b, i, o) * (1./NBSDFSAMPS);
749                          copycolor(col, cinc);
750 <                        o = k*nazi + j;
750 >                        if (b->nout != b->ninc)
751 >                                o = k*nazi + j;
752                          if (o == direct_out)
753                                  addcolor(col, cdir);    /* minus direct */
754                          scalecolor(col, wt);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines