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

Comparing ray/src/rt/aniso.c (file contents):
Revision 2.6 by greg, Wed Jan 15 11:41:47 1992 UTC vs.
Revision 2.7 by greg, Wed Jan 15 16:59:55 1992 UTC

# Line 250 | Line 250 | register RAY  *r;
250                          } else {
251                                  for (i = 0; i < 3; i++)         /* perturb */
252                                          nd.prdir[i] = r->rdir[i] -
253 <                                                        .75*r->pert[i];
253 >                                                        0.5*r->pert[i];
254                                  if (DOT(nd.prdir, r->ron) < -FTINY)
255                                          normalize(nd.prdir);    /* OK */
256                                  else
# Line 389 | Line 389 | register ANISODAT  *np;
389                  ndims--;
390          }
391                                          /* compute transmission */
392 +        if ((np->specfl & (SP_TRAN|SP_TBLT)) == SP_TRAN &&
393 +                        rayorigin(&sr, r, SPECULAR, np->tspec) == 0) {
394 +                dimlist[ndims++] = (int)np->mp;
395 +                d = urand(ilhash(dimlist,ndims)+1823+samplendx);
396 +                multisamp(rv, 2, d);
397 +                d = 2.0*PI * rv[0];
398 +                cosp = cos(d);
399 +                sinp = sin(d);
400 +                rv[1] = 1.0 - specjitter*rv[1];
401 +                if (rv[1] <= FTINY)
402 +                        d = 1.0;
403 +                else
404 +                        d = sqrt(-log(rv[1]) /
405 +                                (cosp*cosp*4./(np->u_alpha*np->u_alpha) +
406 +                                 sinp*sinp*4./(np->v_alpha*np->v_alpha)));
407 +                for (i = 0; i < 3; i++)
408 +                        sr.rdir[i] = np->prdir[i] +
409 +                                        d*(cosp*np->u[i] + sinp*np->v[i]);
410 +                if (DOT(sr.rdir, r->ron) < -FTINY)
411 +                        normalize(sr.rdir);             /* OK, normalize */
412 +                else
413 +                        VCOPY(sr.rdir, np->prdir);      /* else no jitter */
414 +                rayvalue(&sr);
415 +                multcolor(sr.rcol, np->scolor);
416 +                addcolor(r->rcol, sr.rcol);
417 +                ndims--;
418 +        }
419   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines