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

Comparing ray/src/rt/ambient.c (file contents):
Revision 2.94 by greg, Tue Feb 24 19:39:26 2015 UTC vs.
Revision 2.101 by schorsch, Sun Mar 6 01:13:17 2016 UTC

# Line 184 | Line 184 | setambient(void)                               /* initialize calculation */
184                                          (flen - lastpos)/AMBVALSIZ);
185                          error(WARNING, errmsg);
186                          fseek(ambfp, lastpos, SEEK_SET);
187 #ifndef _WIN32 /* XXX we need a replacement for that one */
187                          ftruncate(fileno(ambfp), (off_t)lastpos);
189 #endif
188                  }
189          } else if ((ambfp = fopen(ambfile, "w+")) != NULL) {
190                  initambfile(1);                 /* else create new file */
# Line 196 | Line 194 | setambient(void)                               /* initialize calculation */
194                  sprintf(errmsg, "cannot open ambient file \"%s\"", ambfile);
195                  error(SYSTEM, errmsg);
196          }
199 #ifdef getc_unlocked
200        flockfile(ambfp);                       /* application-level lock */
201 #endif
197   #ifdef  F_SETLKW
198          aflock(F_UNLCK);                        /* release file */
199   #endif
# Line 219 | Line 214 | ambdone(void)                  /* close ambient file and free memory
214                  lastpos = -1;
215          }
216                                          /* free ambient tree */
217 <        unloadatree(&atrunk, &avfree);
217 >        unloadatree(&atrunk, avfree);
218                                          /* reset state variables */
219          avsum = 0.;
220          navsum = 0;
# Line 667 | Line 662 | multambient(           /* compute ambient component & multiply
662  
663          /* PMAP: Factor in ambient from global photon map (if enabled) and return
664           * as all ambient components accounted for */
665 <        if (ambGlobalPmap(aval, r, rdepth))
665 >        if (ambPmap(aval, r, rdepth))
666                  return;
667  
668          /* PMAP: Otherwise factor in ambient from caustic photon map
669 <         * (ambCausticPmap() returns zero if caustic photons disabled) and
669 >         * (ambPmapCaustic() returns zero if caustic photons disabled) and
670           * continue with RADIANCE ambient calculation */
671          copycolor(caustic, aval);
672 <        ambCausticPmap(caustic, r, rdepth);
672 >        ambPmapCaustic(caustic, r, rdepth);
673          
674          if (ambdiv <= 0)                        /* no ambient calculation */
675                  goto dumbamb;
# Line 1229 | Line 1224 | sortambvals(                   /* resort ambient values */
1224                          oldatrunk = atrunk;
1225                          atrunk.alist = NULL;
1226                          atrunk.kid = NULL;
1227 <                        unloadatree(&oldatrunk, &avinsert);
1227 >                        unloadatree(&oldatrunk, avinsert);
1228                  }
1229          } else {                        /* sort memory by last access time */
1230                  /*
# Line 1246 | Line 1241 | sortambvals(                   /* resort ambient values */
1241                  eputs(errmsg);
1242   #endif
1243                  i_avlist = 0;
1244 <                unloadatree(&atrunk, &av2list); /* empty current tree */
1244 >                unloadatree(&atrunk, av2list);  /* empty current tree */
1245   #ifdef DEBUG
1246                  if (i_avlist < nambvals)
1247                          error(CONSISTENCY, "missing ambient values in sortambvals");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines