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.46 by greg, Thu Mar 10 22:37:00 2005 UTC vs.
Revision 2.48 by greg, Fri Apr 15 04:44:51 2005 UTC

# Line 50 | Line 50 | rayorigin(             /* start new ray from old one */
50                  r->crtype = r->rtype = rt;
51                  r->rsrc = -1;
52                  r->clipset = NULL;
53                r->revf = raytrace;
53                  copycolor(r->cext, cextinction);
54                  copycolor(r->albedo, salbedo);
55                  r->gecc = seccg;
# Line 70 | Line 69 | rayorigin(             /* start new ray from old one */
69                          r->clipset = ro->newcset;
70                          r->rmax = ro->rmax <= FTINY ? 0.0 : ro->rmax - ro->rot;
71                  }
73                r->revf = ro->revf;
72                  copycolor(r->cext, ro->cext);
73                  copycolor(r->albedo, ro->albedo);
74                  r->gecc = ro->gecc;
# Line 110 | Line 108 | rayclear(                      /* clear a ray for (re)evaluation */
108  
109  
110   extern void
111 < raytrace(                       /* trace a ray and compute its value */
111 > rayvalue(                       /* trace a ray and compute its value */
112          RAY  *r
113   )
114   {
# Line 162 | Line 160 | rayshade(              /* shade ray r with material mod */
160          int  mod
161   )
162   {
165        int  gotmat;
163          register OBJREC  *m;
164 +
165          r->rt = r->rot;                 /* set effective ray length */
166 <        for (gotmat = 0; !gotmat && mod != OVOID; mod = m->omod) {
166 >        for ( ; mod != OVOID; mod = m->omod) {
167                  m = objptr(mod);
168                  /****** unnecessary test since modifier() is always called
169                  if (!ismodifier(m->otype)) {
# Line 184 | Line 182 | rayshade(              /* shade ray r with material mod */
182                          if (!islight(m->otype))
183                                  m = &Lamb;
184                  }
185 <                                        /* materials call raytexture */
186 <                gotmat = (*ofun[m->otype].funp)(m, r);
185 >                if ((*ofun[m->otype].funp)(m, r))
186 >                        return(1);      /* materials call raytexture() */
187          }
188 <        return(gotmat);
188 >        return(0);                      /* no material! */
189   }
190  
191  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines