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.65 by greg, Thu Aug 21 10:33:49 2014 UTC vs.
Revision 2.66 by greg, Thu Sep 4 09:09:08 2014 UTC

# Line 610 | Line 610 | static uint32
610   ambcorral(AMBHEMI *hp, FVECT uv[2], const double r0, const double r1)
611   {
612          const double    max_d = 1.0/(minarad*ambacc + 0.001);
613 <        const double    ang_res = 0.5*PI/(hp->ns-1);
614 <        const double    ang_step = ang_res/((int)(16/PI*ang_res) + (1+FTINY));
613 >        const double    ang_res = 0.5*PI/hp->ns;
614 >        const double    ang_step = ang_res/((int)(16/PI*ang_res) + 1.01);
615          double          avg_d = 0;
616          uint32          flgs = 0;
617          FVECT           vec;
# Line 642 | Line 642 | ambcorral(AMBHEMI *hp, FVECT uv[2], const double r0, c
642                  if ((r0*r0*u*u + r1*r1*v*v) * ap->d*ap->d <= u*u + v*v)
643                          continue;       /* occluder outside ellipse */
644                  ang = atan2a(v, u);     /* else set direction flags */
645 <                for (a1 = ang-.5*ang_res; a1 <= ang+.5*ang_res; a1 += ang_step)
645 >                for (a1 = ang-ang_res; a1 <= ang+ang_res; a1 += ang_step)
646                          flgs |= 1L<<(int)(16/PI*(a1 + 2.*PI*(a1 < 0)));
647              }
648                                          /* add low-angle incident (< 20deg) */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines