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.64 by greg, Fri Jun 1 19:17:17 2012 UTC vs.
Revision 2.66 by greg, Tue Feb 24 19:39:27 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 35 | Line 36 | static int checkhit(RAY  *r, CUBE  *cu, OBJECT  *cxs);
36   static void checkset(OBJECT  *os, OBJECT  *cs);
37  
38  
39 < extern int
39 > int
40   rayorigin(              /* start new ray from old one */
41          RAY  *r,
42          int  rt,
# Line 124 | Line 125 | rayorigin(             /* start new ray from old one */
125   }
126  
127  
128 < extern void
128 > void
129   rayclear(                       /* clear a ray for (re)evaluation */
130          RAY  *r
131   )
# Line 143 | Line 144 | rayclear(                      /* clear a ray for (re)evaluation */
144   }
145  
146  
147 < extern void
147 > void
148   raytrace(                       /* trace a ray and compute its value */
149          RAY  *r
150   )
# Line 163 | Line 164 | raytrace(                      /* trace a ray and compute its value */
164   }
165  
166  
167 < extern void
167 > void
168   raycont(                        /* check for clipped object and continue */
169          RAY  *r
170   )
# Line 174 | Line 175 | raycont(                       /* check for clipped object and continue */
175   }
176  
177  
178 < extern void
178 > void
179   raytrans(                       /* transmit ray as is */
180          RAY  *r
181   )
# Line 190 | Line 191 | raytrans(                      /* transmit ray as is */
191   }
192  
193  
194 < extern int
194 > int
195   rayshade(               /* shade ray r with material mod */
196          RAY  *r,
197          int  mod
# Line 225 | Line 226 | rayshade(              /* shade ray r with material mod */
226   }
227  
228  
229 < extern void
229 > void
230   rayparticipate(                 /* compute ray medium participation */
231          RAY  *r
232   )
# Line 249 | Line 250 | rayparticipate(                        /* compute ray medium participation
250          multcolor(r->rcol, ce);                 /* path extinction */
251          if (r->crtype & SHADOW || intens(r->albedo) <= FTINY)
252                  return;                         /* no scattering */
253 <        setcolor(ca,
254 <                colval(r->albedo,RED)*colval(ambval,RED)*(1.-colval(ce,RED)),
255 <                colval(r->albedo,GRN)*colval(ambval,GRN)*(1.-colval(ce,GRN)),
256 <                colval(r->albedo,BLU)*colval(ambval,BLU)*(1.-colval(ce,BLU)));
257 <        addcolor(r->rcol, ca);                  /* ambient in scattering */
253 >        
254 >        /* PMAP: indirect inscattering accounted for by volume photons? */
255 >        if (!volumePhotonMapping) {
256 >                setcolor(ca,
257 >                        colval(r->albedo,RED)*colval(ambval,RED)*(1.-colval(ce,RED)),
258 >                        colval(r->albedo,GRN)*colval(ambval,GRN)*(1.-colval(ce,GRN)),
259 >                        colval(r->albedo,BLU)*colval(ambval,BLU)*(1.-colval(ce,BLU)));
260 >                addcolor(r->rcol, ca);                  /* ambient in scattering */
261 >        }
262 >        
263          srcscatter(r);                          /* source in scattering */
264   }
265  
266  
267 < extern void
267 > void
268   raytexture(                     /* get material modifiers */
269          RAY  *r,
270          OBJECT  mod
# Line 283 | Line 289 | raytexture(                    /* get material modifiers */
289   }
290  
291  
292 < extern int
292 > int
293   raymixture(             /* mix modifiers */
294          RAY  *r,
295          OBJECT  fore,
# Line 343 | Line 349 | raymixture(            /* mix modifiers */
349   }
350  
351  
352 < extern double
352 > double
353   raydist(                /* compute (cumulative) ray distance */
354          const RAY  *r,
355          int  flags
# Line 359 | Line 365 | raydist(               /* compute (cumulative) ray distance */
365   }
366  
367  
368 < extern void
368 > void
369   raycontrib(             /* compute (cumulative) ray contribution */
370          RREAL  rc[3],
371          const RAY  *r,
# Line 385 | Line 391 | raycontrib(            /* compute (cumulative) ray contribution
391   }
392  
393  
394 < extern double
394 > double
395   raynormal(              /* compute perturbed normal for ray */
396          FVECT  norm,
397          RAY  *r
# Line 421 | Line 427 | raynormal(             /* compute perturbed normal for ray */
427   }
428  
429  
430 < extern void
430 > void
431   newrayxf(                       /* get new tranformation matrix for ray */
432          RAY  *r
433   )
# Line 459 | Line 465 | newrayxf(                      /* get new tranformation matrix for ray */
465   }
466  
467  
468 < extern void
468 > void
469   flipsurface(                    /* reverse surface orientation */
470          RAY  *r
471   )
# Line 474 | Line 480 | flipsurface(                   /* reverse surface orientation */
480   }
481  
482  
483 < extern void
483 > void
484   rayhit(                 /* standard ray hit test */
485          OBJECT  *oset,
486          RAY  *r
# Line 491 | Line 497 | rayhit(                        /* standard ray hit test */
497   }
498  
499  
500 < extern int
500 > int
501   localhit(               /* check for hit in the octree */
502          RAY  *r,
503          CUBE  *scene

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines