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

Comparing ray/src/rt/srcdraw.c (file contents):
Revision 2.8 by schorsch, Sun Jul 27 22:12:03 2003 UTC vs.
Revision 2.9 by greg, Wed Oct 1 22:07:19 2003 UTC

# Line 263 | Line 263 | sourcepoly(sn, sp)                     /* compute image polygon for sour
263   int     sn;
264   RREAL   sp[MAXVERT][2];
265   {
266 <        static char     cubeord[8][6] = {{1,3,2,6,4,5},{0,4,5,7,3,2},
266 >        static short    cubeord[8][6] = {{1,3,2,6,4,5},{0,4,5,7,3,2},
267                                           {0,1,3,7,6,4},{0,1,5,7,6,2},
268                                           {0,2,6,7,5,1},{0,4,6,7,3,1},
269                                           {0,2,3,7,5,4},{1,5,4,6,2,3}};
# Line 409 | Line 409 | int    x0, xsiz, y0, ysiz;             /* origin and size of subimag
409                                  if (source[sp->sn].sflags & SSPOT &&
410                                                  spotout(&sr, source[sp->sn].sl.s))
411                                          continue;       /* outside spot */
412 <                                rayorigin(&sr, NULL, SHADOW, 1.0);
413 <                                sr.rsrc = sp->sn;
412 >                                w = poly_area(ppoly, npv) * hres * vres;
413 >                                if (w < .95) {          /* subpixel source */
414 >                                        rayorigin(&sr, NULL, SHADOW, 1.0);
415 >                                        sr.rsrc = sp->sn;
416 >                                } else
417 >                                        rayorigin(&sr, NULL, PRIMARY, 1.0);
418                                  rayvalue(&sr);          /* compute value */
419                                  if (bright(sr.rcol) <= FTINY)
420                                          continue;       /* missed/blocked */
# Line 419 | Line 423 | int    x0, xsiz, y0, ysiz;             /* origin and size of subimag
423                                                  sr.rt < 0.999*zbf[y-y0][x-x0])
424                                          zbf[y-y0][x-x0] = sr.rt;
425                                  else if (!bigdiff(sr.rcol, pic[y-y0][x-x0],
426 <                                                0.001)) /* source sample */
426 >                                                0.01))  /* source sample */
427                                          setcolor(pic[y-y0][x-x0], 0., 0., 0.);
424                                w = poly_area(ppoly, npv) * hres * vres;
428                                  scalecolor(sr.rcol, w);
429                                  scalecolor(pic[y-y0][x-x0], 1.-w);
430                                  addcolor(pic[y-y0][x-x0], sr.rcol);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines