--- ray/src/rt/m_mirror.c 1991/11/12 17:10:20 2.1 +++ ray/src/rt/m_mirror.c 1995/07/26 16:53:25 2.4 @@ -43,15 +43,18 @@ register RAY *r; /* check for substitute material */ if (m->oargs.nsargs > 0 && (r->rsrc < 0 || source[r->rsrc].so != r->ro)) { - rayshade(r, modifier(m->oargs.sarg[0])); - return; + if (!strcmp(m->oargs.sarg[0], VOIDID)) { + raytrans(r); + return(1); + } + return(rayshade(r, modifier(m->oargs.sarg[0]))); } /* check for bad source ray */ if (r->rsrc >= 0 && source[r->rsrc].so != r->ro) - return; + return(1); if (r->rod < 0.) /* back is black */ - return; + return(1); /* get modifiers */ raytexture(r, m->omod); /* assign material color */ @@ -72,14 +75,19 @@ register RAY *r; double pdot; if (rayorigin(&nr, r, REFLECTED, bright(mcolor)) < 0) - return; + return(1); pdot = raynormal(pnorm, r); /* use textures */ for (i = 0; i < 3; i++) nr.rdir[i] = r->rdir[i] + 2.*pdot*pnorm[i]; + /* check for penetration */ + if (DOT(nr.rdir, r->ron) <= FTINY) + for (i = 0; i < 3; i++) + nr.rdir[i] = r->rdir[i] + 2.*r->rod*r->ron[i]; } rayvalue(&nr); multcolor(nr.rcol, mcolor); addcolor(r->rcol, nr.rcol); + return(1); }