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.35 by greg, Fri Apr 25 18:39:22 2014 UTC vs.
Revision 2.36 by greg, Sat Apr 26 04:37:48 2014 UTC

# Line 70 | Line 70 | inithemi(                      /* initialize sampling hemisphere */
70          d = 1.0/(n*n);
71          scalecolor(hp->acoef, d);
72                                          /* make tangent plane axes */
73 <        hp->uy[0] = 0.1 - 0.2*frandom();
74 <        hp->uy[1] = 0.1 - 0.2*frandom();
75 <        hp->uy[2] = 0.1 - 0.2*frandom();
76 <        for (i = 0; i < 3; i++)
77 <                if (r->ron[i] < 0.6 && r->ron[i] > -0.6)
78 <                        break;
79 <        if (i >= 3)
73 >        hp->uy[0] = hp->uy[1] = hp->uy[2] = 0;
74 >        for (i = 3; i--; )
75 >                if ((0.6 < r->ron[i]) & (r->ron[i] < 0.6))
76 >                        hp->uy[i] = 0.1+frandom();
77 >        if (DOT(hp->uy,hp->uy) <= FTINY)
78                  error(CONSISTENCY, "bad ray direction in inithemi()");
81        hp->uy[i] = 1.0;
79          VCROSS(hp->ux, hp->uy, r->ron);
80          normalize(hp->ux);
81          VCROSS(hp->uy, r->ron, hp->ux);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines