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.123 by greg, Fri Apr 5 01:10:26 2024 UTC vs.
Revision 2.128 by greg, Thu Dec 19 19:34:31 2024 UTC

# Line 382 | Line 382 | plugaleak(RAY *r, AMBVAL *ap, FVECT anorm, double ang)
382          rtst.rmax = normalize(rtst.rdir);       /* short ray test */
383          while (localhit(&rtst, &thescene)) {    /* check for occluder */
384                  OBJREC  *m = findmaterial(rtst.ro);
385 <                if (m != NULL && !istransp(m->otype) && !isBSDFproxy(m) &&
385 >                if (m != NULL && !istransp(m) && !isBSDFproxy(m) &&
386                                  (rtst.clipset == NULL ||
387                                          !inset(rtst.clipset, rtst.ro->omod)))
388                          return(1);              /* plug light leak */
# Line 630 | Line 630 | initambfile(           /* initialize ambient file */
630   {
631          extern char  *progname, *octname;
632          static char  *mybuf = NULL;
633 +        int  ntries = 3;
634  
635   #ifdef  F_SETLKW
636          aflock(cre8 ? F_WRLCK : F_RDLCK);
# Line 665 | Line 666 | retry:
666                  fputc('\n', ambfp);
667                  putambmagic(ambfp);
668          } else if (getheader(ambfp, amb_headline, NULL) < 0 || !hasambmagic(ambfp)) {
668 #ifndef  F_SETLKW
669                static int      ntries = 3;
669                  if (--ntries > 0 && ftell(ambfp) == 0) {
670 + #ifdef  F_SETLKW
671 +                        aflock(F_UNLCK);
672                          clearerr(ambfp);
673                          sleep(2);
674 +                        aflock(F_RDLCK);
675 + #else
676 +                        clearerr(ambfp);
677 +                        sleep(2);
678 + #endif
679                          goto retry;
680                  }
675 #endif
681                  error(USER, "bad/incompatible ambient file");
682          }
683          if ((AMB_CNDX != CNDX) | (AMB_WLPART != WLPART)) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines