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.42 by greg, Mon Sep 20 17:32:04 2004 UTC vs.
Revision 2.43 by greg, Tue Apr 19 01:15:06 2005 UTC

# Line 276 | Line 276 | m_aniso(                       /* shade ray that hit something anisotropic
276                  agaussamp(r, &nd);
277  
278          if (nd.rdiff > FTINY) {         /* ambient from this side */
279 <                ambient(ctmp, r, nd.pnorm);
279 >                copycolor(ctmp, nd.mcolor);     /* modified by material color */
280                  if (nd.specfl & SP_RBLT)
281                          scalecolor(ctmp, 1.0-nd.trans);
282                  else
283                          scalecolor(ctmp, nd.rdiff);
284 <                multcolor(ctmp, nd.mcolor);     /* modified by material color */
284 >                multambient(ctmp, r, nd.pnorm);
285                  addcolor(r->rcol, ctmp);        /* add to returned color */
286          }
287          if (nd.tdiff > FTINY) {         /* ambient from other side */
# Line 291 | Line 291 | m_aniso(                       /* shade ray that hit something anisotropic
291                  bnorm[0] = -nd.pnorm[0];
292                  bnorm[1] = -nd.pnorm[1];
293                  bnorm[2] = -nd.pnorm[2];
294 <                ambient(ctmp, r, bnorm);
294 >                copycolor(ctmp, nd.mcolor);     /* modified by color */
295                  if (nd.specfl & SP_TBLT)
296                          scalecolor(ctmp, nd.trans);
297                  else
298                          scalecolor(ctmp, nd.tdiff);
299 <                multcolor(ctmp, nd.mcolor);     /* modified by color */
299 >                multambient(ctmp, r, bnorm);
300                  addcolor(r->rcol, ctmp);
301                  flipsurface(r);
302          }
# Line 352 | Line 352 | agaussamp(             /* sample anisotropic gaussian specular */
352          register int  i;
353                                          /* compute reflection */
354          if ((np->specfl & (SP_REFL|SP_RBLT)) == SP_REFL &&
355 <                        rayorigin(&sr, r, SPECULAR, np->rspec) == 0) {
355 >                        rayorigin(&sr, SPECULAR, r, np->scolor) == 0) {
356                  dimlist[ndims++] = (int)np->mp;
357                  for (niter = 0; niter < MAXITER; niter++) {
358                          if (niter)
# Line 381 | Line 381 | agaussamp(             /* sample anisotropic gaussian specular */
381                                  sr.rdir[i] = r->rdir[i] + d*h[i];
382                          if (DOT(sr.rdir, r->ron) > FTINY) {
383                                  rayvalue(&sr);
384 <                                multcolor(sr.rcol, np->scolor);
384 >                                multcolor(sr.rcol, sr.rcoef);
385                                  addcolor(r->rcol, sr.rcol);
386                                  break;
387                          }
# Line 389 | Line 389 | agaussamp(             /* sample anisotropic gaussian specular */
389                  ndims--;
390          }
391                                          /* compute transmission */
392 +        copycolor(sr.rcoef, np->mcolor);                /* modify by material color */
393 +        scalecolor(sr.rcoef, np->tspec);
394          if ((np->specfl & (SP_TRAN|SP_TBLT)) == SP_TRAN &&
395 <                        rayorigin(&sr, r, SPECULAR, np->tspec) == 0) {
395 >                        rayorigin(&sr, SPECULAR, r, sr.rcoef) == 0) {
396                  dimlist[ndims++] = (int)np->mp;
397                  for (niter = 0; niter < MAXITER; niter++) {
398                          if (niter)
# Line 417 | Line 419 | agaussamp(             /* sample anisotropic gaussian specular */
419                          if (DOT(sr.rdir, r->ron) < -FTINY) {
420                                  normalize(sr.rdir);     /* OK, normalize */
421                                  rayvalue(&sr);
422 <                                scalecolor(sr.rcol, np->tspec);
421 <                                multcolor(sr.rcol, np->mcolor); /* modify */
422 >                                multcolor(sr.rcol, sr.rcoef);
423                                  addcolor(r->rcol, sr.rcol);
424                                  break;
425                          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines