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

Comparing ray/src/rt/ambcomp.c (file contents):
Revision 2.33 by greg, Thu Apr 24 19:16:52 2014 UTC vs.
Revision 2.34 by greg, Thu Apr 24 23:15:10 2014 UTC

# Line 121 | Line 121 | ambsample(                             /* sample an ambient direction */
121          dimlist[ndims++] = i*hp->ns + j + 90171;
122          rayvalue(&ar);                  /* evaluate ray */
123          ndims--;
124 <        if (ar.rt > 20.0*maxarad)       /* limit vertex distance */
125 <                ar.rt = 20.0*maxarad;
124 >                                        /* limit vertex distance */
125 >        if (ar.rt > 10.0*thescene.cusize)
126 >                ar.rt = 10.0*thescene.cusize;
127          else if (ar.rt <= FTINY)        /* should never happen! */
128                  goto badsample;
129          VSUM(ap->p, ar.rorg, ar.rdir, ar.rt);
# Line 557 | Line 558 | doambient(                             /* compute ambient component */
558                                  ra[1] = minarad;
559                                          /* cap gradient if necessary */
560                          if (pg != NULL) {
561 <                                d = (pg[0]*pg[0] + pg[1]*pg[1])*ra[0]*ra[0];
561 >                                d = pg[0]*pg[0]*ra[0]*ra[0] +
562 >                                                pg[1]*pg[1]*ra[1]*ra[1];
563                                  if (d > 1.0) {
564                                          d = 1.0/sqrt(d);
565                                          pg[0] *= d;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines