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

Comparing ray/src/rt/normal.c (file contents):
Revision 2.7 by greg, Wed Jan 15 11:41:44 1992 UTC vs.
Revision 2.8 by greg, Wed Jan 15 16:59:52 1992 UTC

# Line 128 | Line 128 | double  omega;                 /* light source size */
128                   *  is always modified by material color.
129                   */
130                                                  /* roughness + source */
131 <                dtmp = np->alpha2 + omega/(2.0*PI);
131 >                dtmp = np->alpha2/2.0 + omega/(2.0*PI);
132                                                  /* gaussian */
133                  dtmp = exp((DOT(np->prdir,ldir)-1.)/dtmp)/(2.*PI)/dtmp;
134                                                  /* worth using? */
# Line 235 | Line 235 | register RAY  *r;
235                          } else {
236                                  for (i = 0; i < 3; i++)         /* perturb */
237                                          nd.prdir[i] = r->rdir[i] -
238 <                                                        .75*r->pert[i];
238 >                                                        0.5*r->pert[i];
239                                  if (DOT(nd.prdir, r->ron) < -FTINY)
240                                          normalize(nd.prdir);    /* OK */
241                                  else
# Line 346 | Line 346 | register NORMDAT  *np;
346                  ndims--;
347          }
348                                          /* compute transmission */
349 +        if ((np->specfl & (SP_TRAN|SP_TBLT)) == SP_TRAN &&
350 +                        rayorigin(&sr, r, SPECULAR, np->tspec) == 0) {
351 +                dimlist[ndims++] = (int)np->mp;
352 +                d = urand(ilhash(dimlist,ndims)+1823+samplendx);
353 +                multisamp(rv, 2, d);
354 +                d = 2.0*PI * rv[0];
355 +                cosp = cos(d);
356 +                sinp = sin(d);
357 +                rv[1] = 1.0 - specjitter*rv[1];
358 +                if (rv[1] <= FTINY)
359 +                        d = 1.0;
360 +                else
361 +                        d = sqrt( np->alpha2/4.0 * -log(rv[1]) );
362 +                for (i = 0; i < 3; i++)
363 +                        sr.rdir[i] = np->prdir[i] + d*(cosp*u[i] + sinp*v[i]);
364 +                if (DOT(sr.rdir, r->ron) < -FTINY)
365 +                        normalize(sr.rdir);             /* OK, normalize */
366 +                else
367 +                        VCOPY(sr.rdir, np->prdir);      /* else no jitter */
368 +                rayvalue(&sr);
369 +                multcolor(sr.rcol, np->scolor);
370 +                addcolor(r->rcol, sr.rcol);
371 +                ndims--;
372 +        }
373   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines