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

Comparing ray/src/rt/rpict.c (file contents):
Revision 2.93 by greg, Sat May 4 00:32:47 2019 UTC vs.
Revision 2.97 by greg, Fri Dec 3 18:10:48 2021 UTC

# Line 135 | Line 135 | static int pixnumber(int  x, int  y, int  xres, int  y
135  
136  
137   void
138 < quit(code)                      /* quit program */
139 < int  code;
138 > quit(int code)                  /* quit program */
139   {
140          if (code)                       /* report status */
141                  report(0);
# Line 341 | Line 340 | rpict(                 /* generate image(s) */
340                  if ((pa < .99) | (pa > 1.01))
341                          fputaspect(pa, stdout);
342                  fputnow(stdout);
343 +                fputprims(stdprims, stdout);
344                  fputformat(COLRFMT, stdout);
345                  putchar('\n');
346                  if (zout != NULL)
# Line 660 | Line 660 | pixvalue(              /* compute pixel value */
660          int  y
661   )
662   {
663        extern void  SDsquare2disk(double ds[2], double seedx, double seedy);
663          RAY  thisray;
664          FVECT   lorg, ldir;
665 <        double  hpos, vpos, vdist, lmax;
665 >        double  hpos, vpos, lmax;
666          int     i;
667                                                  /* compute view ray */
668          setcolor(col, 0.0, 0.0, 0.0);
# Line 672 | Line 671 | pixvalue(              /* compute pixel value */
671          if ((thisray.rmax = viewray(thisray.rorg, thisray.rdir,
672                                          &ourview, hpos, vpos)) < -FTINY)
673                  return(0.0);
675
676        vdist = ourview.vdist;
674                                                  /* set pixel index */
675          samplendx = pixnumber(x,y,hres,vres);
676                                                  /* optional motion blur */
# Line 688 | Line 685 | pixvalue(              /* compute pixel value */
685                  }
686                  if (normalize(thisray.rdir) == 0.0)
687                          return(0.0);
691                vdist = (1.-d)*vdist + d*lastview.vdist;
688          }
689 <                                                /* optional depth-of-field */
690 <        if (dblur > FTINY) {
691 <                double  vc, df[2];
696 <                                                /* random point on disk */
697 <                SDsquare2disk(df, frandom(), frandom());
698 <                df[0] *= .5*dblur;
699 <                df[1] *= .5*dblur;
700 <                if ((ourview.type == VT_PER) | (ourview.type == VT_PAR)) {
701 <                        double  adj = 1.0;
702 <                        if (ourview.type == VT_PER)
703 <                                adj /= DOT(thisray.rdir, ourview.vdir);
704 <                        df[0] /= sqrt(ourview.hn2);
705 <                        df[1] /= sqrt(ourview.vn2);
706 <                        for (i = 3; i--; ) {
707 <                                vc = ourview.vp[i] + adj*vdist*thisray.rdir[i];
708 <                                thisray.rorg[i] += df[0]*ourview.hvec[i] +
709 <                                                        df[1]*ourview.vvec[i] ;
710 <                                thisray.rdir[i] = vc - thisray.rorg[i];
711 <                        }
712 <                } else {                        /* non-standard view case */
713 <                        double  dfd = PI/4.*dblur*(.5 - frandom());
714 <                        if ((ourview.type != VT_ANG) & (ourview.type != VT_PLS)) {
715 <                                if (ourview.type != VT_CYL)
716 <                                        df[0] /= sqrt(ourview.hn2);
717 <                                df[1] /= sqrt(ourview.vn2);
718 <                        }
719 <                        for (i = 3; i--; ) {
720 <                                vc = ourview.vp[i] + vdist*thisray.rdir[i];
721 <                                thisray.rorg[i] += df[0]*ourview.hvec[i] +
722 <                                                        df[1]*ourview.vvec[i] +
723 <                                                        dfd*ourview.vdir[i] ;
724 <                                thisray.rdir[i] = vc - thisray.rorg[i];
725 <                        }
726 <                }
727 <                if (normalize(thisray.rdir) == 0.0)
728 <                        return(0.0);
729 <        }
689 >                                                /* depth-of-field */
690 >        if (!jitteraperture(thisray.rorg, thisray.rdir, &ourview, dblur))
691 >                return(0.0);
692  
693          rayorigin(&thisray, PRIMARY, NULL, NULL);
694  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines