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

Comparing ray/src/rt/virtuals.c (file contents):
Revision 2.23 by greg, Thu Nov 8 00:54:07 2018 UTC vs.
Revision 2.26 by greg, Wed Nov 15 18:02:53 2023 UTC

# Line 19 | Line 19 | static const char      RCSid[] = "$Id$";
19   #define  MINSAMPLES     16              /* minimum number of pretest samples */
20   #define  STESTMAX       32              /* maximum seeks per sample */
21  
22 #define FEQ(a,b)        ((a)-(b)+FTINY >= 0 && (b)-(a)+FTINY >= 0)
22  
24
23   static OBJECT  *vobject;                /* virtual source objects */
24   static int  nvobjects = 0;              /* number of virtual source objects */
25  
# Line 33 | Line 31 | isident4(MAT4 m)
31  
32          for (i = 4; i--; )
33                  for (j = 4; j--; )
34 <                        if (!FEQ(m[i][j], i==j))
34 >                        if (!FABSEQ(m[i][j], i==j))
35                                  return(0);
36          return(1);
37   }
# Line 139 | Line 137 | vsmaterial(                    /* get virtual source material pointer *
137          OBJREC  *m;
138  
139          i = o->omod;
140 <        m = findmaterial(objptr(i));
140 >        m = findmaterial(o);
141          if (m == NULL)
142                  return(objptr(i));
143          if (m->otype != MAT_ILLUM || m->oargs.nsargs < 1 ||
# Line 389 | Line 387 | vstestvis(             /* pretest source visibility */
387                  }
388                  sr.revf = srcvalue;
389                  rayvalue(&sr);                  /* check sample validity */
390 <                if ((d = bright(sr.rcol)) <= FTINY)
390 >                if ((d = scolor_mean(sr.rcol)) <= FTINY)
391                          continue;
392                  nok++;                  /* got sample; check obstructions */
393                  rayclear(&sr);
394                  sr.revf = raytrace;
395                  rayvalue(&sr);
396 <                if ((d1 = bright(sr.rcol)) > FTINY) {
396 >                if ((d1 = scolor_mean(sr.rcol)) > FTINY) {
397                          if (d - d1 > FTINY) {
398   #ifdef DEBUG
399                                  fprintf(stderr, "\tpartially shadowed\n");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines