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.32 by greg, Thu Apr 24 17:36:43 2014 UTC vs.
Revision 2.33 by greg, Thu Apr 24 19:16:52 2014 UTC

# Line 555 | Line 555 | doambient(                             /* compute ambient component */
555                          ra[0] = minarad;
556                          if (ra[1] < minarad)
557                                  ra[1] = minarad;
558 +                                        /* cap gradient if necessary */
559 +                        if (pg != NULL) {
560 +                                d = (pg[0]*pg[0] + pg[1]*pg[1])*ra[0]*ra[0];
561 +                                if (d > 1.0) {
562 +                                        d = 1.0/sqrt(d);
563 +                                        pg[0] *= d;
564 +                                        pg[1] *= d;
565 +                                }
566 +                        }
567                  }
568                  ra[0] *= d = 1.0/sqrt(sqrt(wt));
569                  if ((ra[1] *= d) > 2.0*ra[0])

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines