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

Comparing ray/src/rt/m_brdf.c (file contents):
Revision 2.26 by greg, Sun Sep 26 15:51:15 2010 UTC vs.
Revision 2.27 by greg, Mon Oct 25 22:57:45 2010 UTC

# Line 271 | Line 271 | m_brdf(                        /* color a ray that hit a BRDTfunc material
271                  objerror(m, WARNING, "compute error");
272          else if (rayorigin(&sr, TRANS, r, ctmp) == 0) {
273                  if (!(r->crtype & SHADOW) && hastexture) {
274 <                        for (i = 0; i < 3; i++) /* perturb direction */
275 <                                sr.rdir[i] = r->rdir[i] - .75*r->pert[i];
274 >                                                /* perturb direction */
275 >                        VSUM(sr.rdir, r->rdir, r->pert, -.75);
276                          if (normalize(sr.rdir) == 0.0) {
277                                  objerror(m, WARNING, "illegal perturbation");
278                                  VCOPY(sr.rdir, r->rdir);
# Line 299 | Line 299 | m_brdf(                        /* color a ray that hit a BRDTfunc material
299          if ((errno == EDOM) | (errno == ERANGE))
300                  objerror(m, WARNING, "compute error");
301          else if (rayorigin(&sr, REFLECTED, r, ctmp) == 0) {
302 <                for (i = 0; i < 3; i++)
303 <                        sr.rdir[i] = r->rdir[i] + 2.0*nd.pdot*nd.pnorm[i];
302 >                VSUM(sr.rdir, r->rdir, nd.pnorm, 2.*nd.pdot);
303                  checknorm(sr.rdir);
304                  rayvalue(&sr);
305                  multcolor(sr.rcol, sr.rcoef);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines