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

Comparing ray/src/rt/source.c (file contents):
Revision 2.69 by greg, Wed Nov 7 18:22:29 2018 UTC vs.
Revision 2.71 by greg, Thu Mar 12 17:19:18 2020 UTC

# Line 9 | Line 9 | static const char RCSid[] = "$Id$";
9  
10   #include  "ray.h"
11   #include  "otypes.h"
12 + #include  "otspecial.h"
13   #include  "rtotypes.h"
14   #include  "source.h"
15   #include  "random.h"
# Line 42 | Line 43 | static int  maxcntr = 0;               /* size of contribution arra
43   static int cntcmp(const void *p1, const void *p2);
44  
45  
45 OBJREC *                        /* find an object's actual material */
46 findmaterial(OBJREC *o)
47 {
48        while (!ismaterial(o->otype)) {
49                if (o->otype == MOD_ALIAS && o->oargs.nsargs) {
50                        OBJECT  aobj;
51                        OBJREC  *ao;
52                        aobj = lastmod(objndx(o), o->oargs.sarg[0]);
53                        if (aobj < 0)
54                                objerror(o, USER, "bad reference");
55                                /* recursive check on alias branch */
56                        if ((ao = findmaterial(objptr(aobj))) != NULL)
57                                return(ao);
58                }
59                if (o->omod == OVOID)
60                        return(NULL);
61                o = objptr(o->omod);
62        }
63        return(o);              /* mixtures will return NULL */
64 }
65
66
46   void
47   marksources(void)                       /* find and mark source objects */
48   {
# Line 542 | Line 521 | srcscatter(                    /* compute source scattering into ray */
521          COLOR  cvext;
522          int  i, j;
523  
524 <        if (r->rot >= FHUGE || r->gecc >= 1.-FTINY)
524 >        if (r->rot >= FHUGE*.99 || r->gecc >= 1.-FTINY)
525                  return;         /* this can never work */
526          /* PMAP: do unconditional inscattering for volume photons */
527          if (!volumePhotonMapping && (r->slights == NULL || r->slights[0] == 0))

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines