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.9 by greg, Thu Jan 30 11:37:04 1992 UTC

# Line 209 | Line 209 | register RAY  *r;
209                                                  /* check threshold */
210                  if (specthresh > FTINY &&
211                                  ((specthresh >= 1.-FTINY ||
212 <                                specthresh + (.1 - .2*urand(8199+samplendx))
213 <                                        > nd.rspec)))
212 >                                specthresh + (.05 - .1*frandom()) > nd.rspec)))
213                          nd.specfl |= SP_RBLT;
214                                                  /* compute refl. direction */
215                  for (i = 0; i < 3; i++)
# Line 240 | Line 239 | register RAY  *r;
239                          if (specthresh > FTINY &&
240                                          ((specthresh >= 1.-FTINY ||
241                                          specthresh +
242 <                                            (.1 - .2*urand(7241+samplendx))
244 <                                                > nd.tspec)))
242 >                                            (.05 - .1*frandom()) > nd.tspec)))
243                                  nd.specfl |= SP_TBLT;
244                          if (r->crtype & SHADOW ||
245                                          DOT(r->pert,r->pert) <= FTINY*FTINY) {
# Line 250 | Line 248 | register RAY  *r;
248                          } else {
249                                  for (i = 0; i < 3; i++)         /* perturb */
250                                          nd.prdir[i] = r->rdir[i] -
251 <                                                        .75*r->pert[i];
251 >                                                        0.5*r->pert[i];
252                                  if (DOT(nd.prdir, r->ron) < -FTINY)
253                                          normalize(nd.prdir);    /* OK */
254                                  else
# Line 389 | Line 387 | register ANISODAT  *np;
387                  ndims--;
388          }
389                                          /* compute transmission */
390 +        if ((np->specfl & (SP_TRAN|SP_TBLT)) == SP_TRAN &&
391 +                        rayorigin(&sr, r, SPECULAR, np->tspec) == 0) {
392 +                dimlist[ndims++] = (int)np->mp;
393 +                d = urand(ilhash(dimlist,ndims)+1823+samplendx);
394 +                multisamp(rv, 2, d);
395 +                d = 2.0*PI * rv[0];
396 +                cosp = cos(d);
397 +                sinp = sin(d);
398 +                rv[1] = 1.0 - specjitter*rv[1];
399 +                if (rv[1] <= FTINY)
400 +                        d = 1.0;
401 +                else
402 +                        d = sqrt(-log(rv[1]) /
403 +                                (cosp*cosp*4./(np->u_alpha*np->u_alpha) +
404 +                                 sinp*sinp*4./(np->v_alpha*np->v_alpha)));
405 +                for (i = 0; i < 3; i++)
406 +                        sr.rdir[i] = np->prdir[i] +
407 +                                        d*(cosp*np->u[i] + sinp*np->v[i]);
408 +                if (DOT(sr.rdir, r->ron) < -FTINY)
409 +                        normalize(sr.rdir);             /* OK, normalize */
410 +                else
411 +                        VCOPY(sr.rdir, np->prdir);      /* else no jitter */
412 +                rayvalue(&sr);
413 +                multcolor(sr.rcol, np->scolor);
414 +                addcolor(r->rcol, sr.rcol);
415 +                ndims--;
416 +        }
417   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines