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.69 by greg, Tue Feb 24 19:39:26 2015 UTC vs.
Revision 2.74 by rschregle, Tue Feb 23 12:42:41 2016 UTC

# Line 112 | Line 112 | dirnorm(               /* compute source contribution */
112                  scalecolor(ctmp, dtmp);
113                  addcolor(cval, ctmp);
114          }
115 <        
115 >
116          if (ldot < -FTINY && ltdiff > FTINY) {
117                  /*
118                   *  Compute diffuse transmission.
# Line 122 | Line 122 | dirnorm(               /* compute source contribution */
122                  scalecolor(ctmp, dtmp);
123                  addcolor(cval, ctmp);
124          }
125 <        
126 <        /* PMAP: skip direct specular via ambient bounce if already accounted for
127 <         * in photon map */
125 >
126          if (ambRayInPmap(np->rp))
127 <                return;
127 >                return;         /* specular already in photon map */
128  
129          if (ldot > FTINY && (np->specfl&(SP_REFL|SP_PURE)) == SP_REFL) {
130                  /*
# Line 192 | Line 190 | m_normal(                      /* color a ray that hit something normal *
190          int  i;
191  
192          /* PMAP: skip transmitted shadow ray if accounted for in photon map */
193 <        if (shadowRayInPmap(r))
194 <                return(1);
193 >        /* No longer needed?
194 >        if (shadowRayInPmap(r) || ambRayInPmap(r))
195 >                return(1); */          
196 >                
197                                                  /* easy shadow test */
198          if (r->crtype & SHADOW && m->otype != MAT_TRANS)
199                  return(1);
# Line 269 | Line 269 | m_normal(                      /* color a ray that hit something normal *
269                  nd.tdiff = nd.tspec = nd.trans = 0.0;
270                                                  /* transmitted ray */
271  
272 <        /* PMAP: skip indirect specular trans via ambient bounce if already
273 <         * accounted for in photon map */
274 <        if (!ambRayInPmap(r) &&
275 <                    (nd.specfl&(SP_TRAN|SP_PURE|SP_TBLT)) == (SP_TRAN|SP_PURE)) {
272 >        if ((nd.specfl&(SP_TRAN|SP_PURE|SP_TBLT)) == (SP_TRAN|SP_PURE)) {
273                  RAY  lr;
274                  copycolor(lr.rcoef, nd.mcolor); /* modified by color */
275                  scalecolor(lr.rcoef, nd.tspec);
# Line 317 | Line 314 | m_normal(                      /* color a ray that hit something normal *
314                  checknorm(nd.vrefl);
315          }
316                                                  /* reflected ray */
317 <        /* PMAP: skip indirect specular refl via ambient ray if already accounted
321 <         * for in photon map */
322 <        if (!ambRayInPmap(r) &&
323 <                    (nd.specfl&(SP_REFL|SP_PURE|SP_RBLT)) == (SP_REFL|SP_PURE)) {
317 >        if ((nd.specfl&(SP_REFL|SP_PURE|SP_RBLT)) == (SP_REFL|SP_PURE)) {
318                  RAY  lr;
319                  if (rayorigin(&lr, REFLECTED, r, nd.scolor) == 0) {
320                          VCOPY(lr.rdir, nd.vrefl);
# Line 340 | Line 334 | m_normal(                      /* color a ray that hit something normal *
334          if (nd.specfl & SP_PURE && nd.rdiff <= FTINY && nd.tdiff <= FTINY)
335                  return(1);                      /* 100% pure specular */
336  
337 <        /* PMAP: skip indirect gaussian via ambient bounce if already accounted
338 <         * for in photon map */
345 <        if (!ambRayInPmap(r))  
346 <                if (!(nd.specfl & SP_PURE))
347 <                        gaussamp(&nd);          /* checks *BLT flags */
337 >        if (!(nd.specfl & SP_PURE))
338 >                gaussamp(&nd);                  /* checks *BLT flags */
339  
340          if (nd.rdiff > FTINY) {         /* ambient from this side */
341                  copycolor(ctmp, nd.mcolor);     /* modified by material color */
# Line 402 | Line 393 | gaussamp(                      /* sample Gaussian specular */
393                          (np->specfl & (SP_TRAN|SP_TBLT)) != SP_TRAN)
394                  return;
395                                          /* set up sample coordinates */
396 <        getperpendicular(u, np->pnorm);
396 >        getperpendicular(u, np->pnorm, rand_samp);
397          fcross(v, np->pnorm, u);
398                                          /* compute reflection */
399          if ((np->specfl & (SP_REFL|SP_RBLT)) == SP_REFL &&

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines