--- ray/src/rt/raytrace.c 1989/10/16 18:57:02 1.6 +++ ray/src/rt/raytrace.c 1990/03/06 08:47:30 1.9 @@ -64,20 +64,30 @@ double rw; rayvalue(r) /* compute a ray's value */ -register RAY *r; +RAY *r; { extern int (*trace)(); if (localhit(r, &thescene) || sourcehit(r)) - rayshade(r, r->ro->omod); + raycont(r); if (trace != NULL) (*trace)(r); /* trace execution */ } +raycont(r) /* check for clipped object and continue */ +register RAY *r; +{ + if (r->clipset != NULL && inset(r->clipset, r->ro->omod)) + raytrans(r); + else + rayshade(r, r->ro->omod); +} + + raytrans(r) /* transmit ray as is */ -RAY *r; +register RAY *r; { RAY tr; @@ -95,12 +105,6 @@ int mod; { static int depth = 0; register OBJREC *m; - /* check for clipped surface */ - if (r->clipset != NULL && r->rot < FHUGE && - inset(r->clipset, mod)) { - raytrans(r); - return; - } /* check for infinite loop */ if (depth++ >= MAXLOOP) objerror(r->ro, USER, "possible modifier loop"); @@ -206,7 +210,7 @@ register RAY *r; * still fraught with problems since reflected rays and similar * directions calculated from the surface normal may spawn rays behind * the surface. The only solution is to curb textures at high - * incidence (Rdot << 1). + * incidence (namely, keep DOT(rdir,pert) < Rdot). */ for (i = 0; i < 3; i++)