--- ray/src/rt/aniso.c 1993/02/12 10:41:05 2.23 +++ ray/src/rt/aniso.c 1994/01/12 16:46:32 2.27 @@ -19,6 +19,8 @@ static char SCCSid[] = "$SunId$ LBL"; extern double specthresh; /* specular sampling threshold */ extern double specjitter; /* specular sampling jitter */ +static agaussamp(), getacoords(); + /* * This routine implements the anisotropic Gaussian * model described by Ward in Siggraph `92 article. @@ -34,8 +36,6 @@ extern double specjitter; /* specular sampling jitte * 8 red grn blu rspec u-rough v-rough trans tspec */ -#define BSPEC(m) (6.0) /* specularity parameter b */ - /* specularity flags */ #define SP_REFL 01 /* has reflected specular component */ #define SP_TRAN 02 /* has transmitted specular */ @@ -181,12 +181,11 @@ register OBJREC *m; register RAY *r; { ANISODAT nd; - double dtmp; COLOR ctmp; register int i; /* easy shadow test */ if (r->crtype & SHADOW) - return; + return(1); if (m->oargs.nfargs != (m->otype == MAT_TRANS2 ? 8 : 6)) objerror(m, USER, "bad number of real arguments"); @@ -220,15 +219,8 @@ register RAY *r; else setcolor(nd.scolor, 1.0, 1.0, 1.0); scalecolor(nd.scolor, nd.rspec); - /* improved model */ - dtmp = exp(-BSPEC(m)*nd.pdot); - for (i = 0; i < 3; i++) - colval(nd.scolor,i) += (1.0-colval(nd.scolor,i))*dtmp; - nd.rspec += (1.0-nd.rspec)*dtmp; /* check threshold */ - if (specthresh > FTINY && - (specthresh >= 1.-FTINY || - specthresh + .05 - .1*frandom() > nd.rspec)) + if (specthresh >= nd.rspec-FTINY) nd.specfl |= SP_RBLT; /* compute refl. direction */ for (i = 0; i < 3; i++) @@ -245,9 +237,7 @@ register RAY *r; if (nd.tspec > FTINY) { nd.specfl |= SP_TRAN; /* check threshold */ - if (specthresh > FTINY && - (specthresh >= 1.-FTINY || - specthresh + .05 - .1*frandom() > nd.tspec)) + if (specthresh >= nd.tspec-FTINY) nd.specfl |= SP_TBLT; if (DOT(r->pert,r->pert) <= FTINY*FTINY) { VCOPY(nd.prdir, r->rdir); @@ -297,6 +287,8 @@ register RAY *r; } /* add direct component */ direct(r, diraniso, &nd); + + return(1); }