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

Comparing ray/src/rt/raytrace.c (file contents):
Revision 2.65 by greg, Wed Feb 19 14:12:48 2014 UTC vs.
Revision 2.67 by greg, Thu May 21 15:28:24 2015 UTC

# Line 14 | Line 14 | static const char RCSid[] = "$Id$";
14   #include  "otypes.h"
15   #include  "otspecial.h"
16   #include  "random.h"
17 + #include  "pmap.h"
18  
19   #define  MAXCSET        ((MAXSET+1)*2-1)        /* maximum check set size */
20  
# Line 106 | Line 107 | rayorigin(             /* start new ray from old one */
107                  return(-1);
108          if (r->crtype & SHADOW)                 /* shadow commitment */
109                  return(0);
110 +                                                /* ambient in photon map? */
111 +        if (r->crtype & AMBIENT && photonMapping)
112 +                return(-1);
113          if (maxdepth <= 0 && rc != NULL) {      /* Russian roulette */
114                  if (minweight <= 0.0)
115                          error(USER, "zero ray weight in Russian roulette");
# Line 181 | Line 185 | raytrans(                      /* transmit ray as is */
185   {
186          RAY  tr;
187  
188 <        if (rayorigin(&tr, TRANS, r, NULL) == 0) {
189 <                VCOPY(tr.rdir, r->rdir);
190 <                rayvalue(&tr);
191 <                copycolor(r->rcol, tr.rcol);
192 <                r->rt = r->rot + tr.rt;
189 <        }
188 >        rayorigin(&tr, TRANS, r, NULL);         /* always continue */
189 >        VCOPY(tr.rdir, r->rdir);
190 >        rayvalue(&tr);
191 >        copycolor(r->rcol, tr.rcol);
192 >        r->rt = r->rot + tr.rt;
193   }
194  
195  
# Line 249 | Line 252 | rayparticipate(                        /* compute ray medium participation
252          multcolor(r->rcol, ce);                 /* path extinction */
253          if (r->crtype & SHADOW || intens(r->albedo) <= FTINY)
254                  return;                         /* no scattering */
255 <        setcolor(ca,
256 <                colval(r->albedo,RED)*colval(ambval,RED)*(1.-colval(ce,RED)),
257 <                colval(r->albedo,GRN)*colval(ambval,GRN)*(1.-colval(ce,GRN)),
258 <                colval(r->albedo,BLU)*colval(ambval,BLU)*(1.-colval(ce,BLU)));
259 <        addcolor(r->rcol, ca);                  /* ambient in scattering */
255 >        
256 >        /* PMAP: indirect inscattering accounted for by volume photons? */
257 >        if (!volumePhotonMapping) {
258 >                setcolor(ca,
259 >                        colval(r->albedo,RED)*colval(ambval,RED)*(1.-colval(ce,RED)),
260 >                        colval(r->albedo,GRN)*colval(ambval,GRN)*(1.-colval(ce,GRN)),
261 >                        colval(r->albedo,BLU)*colval(ambval,BLU)*(1.-colval(ce,BLU)));
262 >                addcolor(r->rcol, ca);                  /* ambient in scattering */
263 >        }
264 >        
265          srcscatter(r);                          /* source in scattering */
266   }
267  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines