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

Comparing ray/src/rt/srcsamp.c (file contents):
Revision 2.5 by greg, Mon Mar 8 12:37:39 1993 UTC vs.
Revision 2.6 by greg, Wed Jul 20 12:48:44 1994 UTC

# Line 82 | Line 82 | nextsample:
82                  goto nextsample;                /* at source! */
83  
84                                          /* compute sample size */
85        si->dom  = source[si->sn].ss2;
85          if (source[si->sn].sflags & SFLAT) {
86 <                si->dom *= sflatform(si->sn, r->rdir);
86 >                si->dom = sflatform(si->sn, r->rdir);
87                  si->dom *= size[SU]*size[SV]/(MAXSPART*(double)MAXSPART);
88          } else if (source[si->sn].sflags & SCYL) {
89 <                si->dom *= scylform(si->sn, r->rdir);
89 >                si->dom = scylform(si->sn, r->rdir);
90                  si->dom *= size[SU]/(double)MAXSPART;
91          } else {
92 <                si->dom *= size[SU]*size[SV]*(double)size[SW] /
92 >                si->dom = size[SU]*size[SV]*(double)size[SW] /
93                                  (MAXSPART*MAXSPART*(double)MAXSPART) ;
94          }
95 <        if (source[si->sn].sflags & SDISTANT)
95 >        if (source[si->sn].sflags & SDISTANT) {
96 >                si->dom *= source[si->sn].ss2;
97                  return(FHUGE);
98 +        }
99          if (si->dom <= 1e-4)
100                  goto nextsample;                /* behind source? */
101 <        si->dom /= d*d;
101 >        si->dom *= source[si->sn].ss2/(d*d);
102          return(d);              /* sample OK, return distance */
103   }
104  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines