--- ray/src/rt/raytrace.c 2005/03/10 22:37:00 2.46 +++ ray/src/rt/raytrace.c 2005/04/15 04:44:51 2.48 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: raytrace.c,v 2.46 2005/03/10 22:37:00 greg Exp $"; +static const char RCSid[] = "$Id: raytrace.c,v 2.48 2005/04/15 04:44:51 greg Exp $"; #endif /* * raytrace.c - routines for tracing and shading rays. @@ -50,7 +50,6 @@ rayorigin( /* start new ray from old one */ r->crtype = r->rtype = rt; r->rsrc = -1; r->clipset = NULL; - r->revf = raytrace; copycolor(r->cext, cextinction); copycolor(r->albedo, salbedo); r->gecc = seccg; @@ -70,7 +69,6 @@ rayorigin( /* start new ray from old one */ r->clipset = ro->newcset; r->rmax = ro->rmax <= FTINY ? 0.0 : ro->rmax - ro->rot; } - r->revf = ro->revf; copycolor(r->cext, ro->cext); copycolor(r->albedo, ro->albedo); r->gecc = ro->gecc; @@ -110,7 +108,7 @@ rayclear( /* clear a ray for (re)evaluation */ extern void -raytrace( /* trace a ray and compute its value */ +rayvalue( /* trace a ray and compute its value */ RAY *r ) { @@ -162,10 +160,10 @@ rayshade( /* shade ray r with material mod */ int mod ) { - int gotmat; register OBJREC *m; + r->rt = r->rot; /* set effective ray length */ - for (gotmat = 0; !gotmat && mod != OVOID; mod = m->omod) { + for ( ; mod != OVOID; mod = m->omod) { m = objptr(mod); /****** unnecessary test since modifier() is always called if (!ismodifier(m->otype)) { @@ -184,10 +182,10 @@ rayshade( /* shade ray r with material mod */ if (!islight(m->otype)) m = &Lamb; } - /* materials call raytexture */ - gotmat = (*ofun[m->otype].funp)(m, r); + if ((*ofun[m->otype].funp)(m, r)) + return(1); /* materials call raytexture() */ } - return(gotmat); + return(0); /* no material! */ }