--- ray/src/gen/mkillum2.c 2009/07/02 04:26:41 2.32 +++ ray/src/gen/mkillum2.c 2009/09/08 23:05:47 2.33 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: mkillum2.c,v 2.32 2009/07/02 04:26:41 greg Exp $"; +static const char RCSid[] = "$Id: mkillum2.c,v 2.33 2009/09/08 23:05:47 greg Exp $"; #endif /* * Routines to do the actual calculation for mkillum @@ -725,7 +725,10 @@ redistribute( /* pass distarr ray sums through BSDF * cp = &direct_discount[3*i]; copycolor(cdir, cp); scalecolor(cdir, -wt); - direct_out = flatindex(dv, nalt, nazi); + if (b->nout != b->ninc) + direct_out = flatindex(dv, nalt, nazi); + else + direct_out = i; /* assumes dist. mirroring */ } for (k = nalt; k--; ) /* loop over distribution */ for (j = nazi; j--; ) { @@ -744,7 +747,8 @@ redistribute( /* pass distarr ray sums through BSDF * } wt = BSDF_value(b, i, o) * (1./NBSDFSAMPS); copycolor(col, cinc); - o = k*nazi + j; + if (b->nout != b->ninc) + o = k*nazi + j; if (o == direct_out) addcolor(col, cdir); /* minus direct */ scalecolor(col, wt);