ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/hd/rholo2.c
(Generate patch)

Comparing ray/src/hd/rholo2.c (file contents):
Revision 3.3 by gregl, Thu Nov 6 16:37:45 1997 UTC vs.
Revision 3.4 by gregl, Mon Dec 1 16:34:36 1997 UTC

# Line 18 | Line 18 | register PACKET        *p;
18   {
19          static FVECT    ro, rd;
20          GCOORD  gc[2];
21 <        double  d;
22 <        long    r1, r2;
21 >        int     ila[2], hsh;
22 >        double  d, sl[4];
23          register int    i;
24  
25          if (!hdbcoord(gc, hdlist[p->hd], p->bi))
26                  error(CONSISTENCY, "bad beam index in packrays");
27 +        ila[0] = p->hd; ila[1] = p->bi;
28 +        hsh = ilhash(ila,2) + p->nc;
29          for (i = 0; i < p->nr; i++) {
30 <                r1 = random(); r2 = random();
31 <                p->ra[i].r[0][0] = r1 ^ r2>>7;
32 <                p->ra[i].r[0][1] = r1<<2 ^ r2;
33 <                p->ra[i].r[1][0] = r1<<4 ^ r2>>15;
34 <                p->ra[i].r[1][1] = r1<<6 ^ r2>>23;
30 >                multisamp(sl, 4, urand(hsh+i));
31 >                p->ra[i].r[0][0] = sl[0] * 256.;
32 >                p->ra[i].r[0][1] = sl[1] * 256.;
33 >                p->ra[i].r[1][0] = sl[2] * 256.;
34 >                p->ra[i].r[1][1] = sl[3] * 256.;
35                  d = hdray(ro, rd, hdlist[p->hd], gc, p->ra[i].r);
36                  if (p->offset != NULL) {
37                          VSUM(ro, ro, rd, d);            /* exterior only */
# Line 58 | Line 60 | register float *rvl;
60                  p->ra[i].d = hdcode(hdlist[p->hd], d);
61                  rvl += 4;
62          }
63 +        p->nc += p->nr;
64   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines