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.50 by greg, Wed May 7 16:02:26 2014 UTC vs.
Revision 2.51 by greg, Wed May 7 20:20:24 2014 UTC

# Line 725 | Line 725 | ambcorral(AMBHEMI *hp, FVECT uv[2], const double r0, c
725          const double    max_d = 1.0/(minarad*ambacc + 0.001);
726          const double    ang_res = 0.5*PI/(hp->ns-1);
727          const double    ang_step = ang_res/((int)(16/PI*ang_res) + (1+FTINY));
728 +        double          avg_d = 0;
729          uint32          flgs = 0;
730          int             i, j;
731 <                                        /* circle around perimeter */
731 >                                        /* check distances above us */
732 >        for (i = hp->ns*3/4; i-- > hp->ns>>2; )
733 >            for (j = hp->ns*3/4; j-- > hp->ns>>2; )
734 >                avg_d += ambsam(hp,i,j).d;
735 >        avg_d *= 4.0/(hp->ns*hp->ns);
736 >        if (avg_d >= max_d)             /* too close to corral? */
737 >                return(0);
738 >                                        /* else circle around perimeter */
739          for (i = 0; i < hp->ns; i++)
740              for (j = 0; j < hp->ns; j += !i|(i==hp->ns-1) ? 1 : hp->ns-1) {
741                  AMBSAMP *ap = &ambsam(hp,i,j);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines