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.51 by greg, Wed May 7 20:20:24 2014 UTC vs.
Revision 2.52 by greg, Wed May 7 21:45:13 2014 UTC

# Line 728 | Line 728 | ambcorral(AMBHEMI *hp, FVECT uv[2], const double r0, c
728          double          avg_d = 0;
729          uint32          flgs = 0;
730          int             i, j;
731 <                                        /* check distances above us */
731 >                                        /* don't bother for a few samples */
732 >        if (hp->ns < 12)
733 >                return(0);
734 >                                        /* check distances overhead */
735          for (i = hp->ns*3/4; i-- > hp->ns>>2; )
736              for (j = hp->ns*3/4; j-- > hp->ns>>2; )
737                  avg_d += ambsam(hp,i,j).d;
738          avg_d *= 4.0/(hp->ns*hp->ns);
739 <        if (avg_d >= max_d)             /* too close to corral? */
739 >        if (avg_d*r0 >= 1.0)            /* ceiling too low for corral? */
740 >                return(0);
741 >        if (avg_d >= max_d)             /* insurance */
742                  return(0);
743                                          /* else circle around perimeter */
744          for (i = 0; i < hp->ns; i++)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines