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

Comparing ray/src/rt/raytrace.c (file contents):
Revision 2.53 by greg, Thu Jun 23 09:11:38 2005 UTC vs.
Revision 2.56 by greg, Mon Aug 22 21:54:41 2005 UTC

# Line 111 | Line 111 | rayorigin(             /* start new ray from old one */
111                          return(-1);             /* upper reflection limit */
112                  if (r->rweight >= minweight)
113                          return(0);
114 <                if (frandom() < r->rweight/minweight)
114 >                if (frandom() > r->rweight/minweight)
115                          return(-1);
116                  rw = minweight/r->rweight;      /* promote survivor */
117                  scalecolor(r->rcoef, rw);
118                  r->rweight = minweight;
119                  return(0);
120          }
121 <        return(r->rlvl <= maxdepth && r->rweight >= minweight ? 0 : -1);
121 >        return(r->rlvl <= abs(maxdepth) && r->rweight >= minweight ? 0 : -1);
122   }
123  
124  
# Line 301 | Line 301 | raymixture(            /* mix modifiers */
301          foremat = backmat = 0;
302                                          /* foreground */
303          fr = *r;
304 <        if (coef > FTINY)
304 >        if (coef > FTINY) {
305 >                scalecolor(fr.rcoef, coef);
306                  foremat = rayshade(&fr, fore);
307 +        }
308                                          /* background */
309          br = *r;
310 <        if (coef < 1.0-FTINY)
310 >        if (coef < 1.0-FTINY) {
311 >                scalecolor(br.rcoef, 1.0-coef);
312                  backmat = rayshade(&br, back);
313 +        }
314                                          /* check for transparency */
315          if (backmat ^ foremat) {
316                  if (backmat && coef > FTINY)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines