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.58 by greg, Tue Oct 12 19:01:14 2010 UTC vs.
Revision 2.61 by greg, Wed Oct 26 03:44:56 2011 UTC

# Line 325 | Line 325 | m_normal(                      /* color a ray that hit something normal *
325  
326          if (nd.rdiff > FTINY) {         /* ambient from this side */
327                  copycolor(ctmp, nd.mcolor);     /* modified by material color */
328 <                if (nd.specfl & SP_RBLT)
329 <                        scalecolor(ctmp, 1.0-nd.trans);
330 <                else
331 <                        scalecolor(ctmp, nd.rdiff);
328 >                scalecolor(ctmp, nd.rdiff);
329 >                if (nd.specfl & SP_RBLT)        /* add in specular as well? */
330 >                        addcolor(ctmp, nd.scolor);
331                  multambient(ctmp, r, hastexture ? nd.pnorm : r->ron);
332                  addcolor(r->rcol, ctmp);        /* add to returned color */
333          }
# Line 405 | Line 404 | gaussamp(                      /* sample Gaussian specular */
404                                  nstarget = 1;
405                  }
406                  setcolor(scol, 0., 0., 0.);
407 <                dimlist[ndims++] = (int)np->mp;
407 >                dimlist[ndims++] = (int)(size_t)np->mp;
408                  maxiter = MAXITER*nstarget;
409                  for (nstaken = ntrials = 0; nstaken < nstarget &&
410                                                  ntrials < maxiter; ntrials++) {
# Line 432 | Line 431 | gaussamp(                      /* sample Gaussian specular */
431                                  continue;
432                          checknorm(sr.rdir);
433                          if (nstarget > 1) {     /* W-G-M-D adjustment */
434 <                                rayclear(&sr);
434 >                                if (nstaken) rayclear(&sr);
435                                  rayvalue(&sr);
436                                  d = 2./(1. + r->rod/d);
437                                  scalecolor(sr.rcol, d);
# Line 469 | Line 468 | gaussamp(                      /* sample Gaussian specular */
468                          } else
469                                  nstarget = 1;
470                  }
471 <                dimlist[ndims++] = (int)np->mp;
471 >                dimlist[ndims++] = (int)(size_t)np->mp;
472                  maxiter = MAXITER*nstarget;
473                  for (nstaken = ntrials = 0; nstaken < nstarget &&
474                                                  ntrials < maxiter; ntrials++) {
# Line 493 | Line 492 | gaussamp(                      /* sample Gaussian specular */
492                          if (DOT(sr.rdir, r->ron) >= -FTINY)
493                                  continue;
494                          normalize(sr.rdir);     /* OK, normalize */
495 <                        if (nstarget > 1)       /* multi-sampling */
495 >                        if (nstaken)            /* multi-sampling */
496                                  rayclear(&sr);
497                          rayvalue(&sr);
498                          multcolor(sr.rcol, sr.rcoef);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines