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.7 by schorsch, Thu Jun 26 00:58:10 2003 UTC vs.
Revision 2.10 by greg, Fri Oct 24 05:29:43 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 285 | Line 285 | RREAL  sp[MAXVERT][2];
285                  for (j = 0; j < 4; j++) {       /* four corners */
286                          for (i = 0; i < 3; i++) {
287                                  ap[i] = s->sloc[i];
288 <                                if (j==1|j==2) ap[i] += s->ss[SU][i];
288 >                                if ((j==1)|(j==2)) ap[i] += s->ss[SU][i];
289                                  else ap[i] -= s->ss[SU][i];
290 <                                if (j==2|j==3) ap[i] += s->ss[SV][i];
290 >                                if ((j==2)|(j==3)) ap[i] += s->ss[SV][i];
291                                  else ap[i] -= s->ss[SV][i];
292                                  if (s->sflags & SDISTANT) {
293                                          ap[i] *= 1. + ourview.vfore;
# 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 */
421                                                          /* modify pixel */
422                                  if (zbf[y-y0] != NULL &&
423 <                                                sr.rt < 0.999*zbf[y-y0][x-x0])
423 >                                                sr.rt < 0.99*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