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.96 by greg, Fri Dec 3 16:50:05 2021 UTC vs.
Revision 2.98 by greg, Tue Jan 24 21:54:49 2023 UTC

# Line 92 | Line 92 | double specjitter = 1.;                /* specular sampling jitter *
92   int  backvis = 1;                       /* back face visibility */
93  
94   int  maxdepth = 7;                      /* maximum recursion depth */
95 < double  minweight = 1e-3;               /* minimum ray weight */
95 > double  minweight = 1e-4;               /* minimum ray weight */
96  
97   char  *ambfile = NULL;                  /* ambient file name */
98   COLOR  ambval = BLKCOLOR;               /* ambient value */
# Line 662 | Line 662 | pixvalue(              /* compute pixel value */
662   {
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 671 | Line 671 | pixvalue(              /* compute pixel value */
671          if ((thisray.rmax = viewray(thisray.rorg, thisray.rdir,
672                                          &ourview, hpos, vpos)) < -FTINY)
673                  return(0.0);
674
675        vdist = ourview.vdist;
674                                                  /* set pixel index */
675          samplendx = pixnumber(x,y,hres,vres);
676                                                  /* optional motion blur */
# Line 687 | Line 685 | pixvalue(              /* compute pixel value */
685                  }
686                  if (normalize(thisray.rdir) == 0.0)
687                          return(0.0);
690                vdist = (1.-d)*vdist + d*lastview.vdist;
688          }
689 <                                                /* optional depth-of-field */
690 <        if (dblur > FTINY) {
691 <                double  vc, df[2];
695 <                                                /* random point on disk */
696 <                SDsquare2disk(df, frandom(), frandom());
697 <                df[0] *= .5*dblur;
698 <                df[1] *= .5*dblur;
699 <                if ((ourview.type == VT_PER) | (ourview.type == VT_PAR)) {
700 <                        double  adj = 1.0;
701 <                        if (ourview.type == VT_PER)
702 <                                adj /= DOT(thisray.rdir, ourview.vdir);
703 <                        df[0] /= sqrt(ourview.hn2);
704 <                        df[1] /= sqrt(ourview.vn2);
705 <                        for (i = 3; i--; ) {
706 <                                vc = ourview.vp[i] + adj*vdist*thisray.rdir[i];
707 <                                thisray.rorg[i] += df[0]*ourview.hvec[i] +
708 <                                                        df[1]*ourview.vvec[i] ;
709 <                                thisray.rdir[i] = vc - thisray.rorg[i];
710 <                        }
711 <                } else {                        /* non-standard view case */
712 <                        double  dfd = PI/4.*dblur*(.5 - frandom());
713 <                        if ((ourview.type != VT_ANG) & (ourview.type != VT_PLS)) {
714 <                                if (ourview.type != VT_CYL)
715 <                                        df[0] /= sqrt(ourview.hn2);
716 <                                df[1] /= sqrt(ourview.vn2);
717 <                        }
718 <                        for (i = 3; i--; ) {
719 <                                vc = ourview.vp[i] + vdist*thisray.rdir[i];
720 <                                thisray.rorg[i] += df[0]*ourview.hvec[i] +
721 <                                                        df[1]*ourview.vvec[i] +
722 <                                                        dfd*ourview.vdir[i] ;
723 <                                thisray.rdir[i] = vc - thisray.rorg[i];
724 <                        }
725 <                }
726 <                if (normalize(thisray.rdir) == 0.0)
727 <                        return(0.0);
728 <        }
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