--- ray/src/rt/aniso.c 2010/10/13 15:29:02 2.50 +++ ray/src/rt/aniso.c 2012/06/09 07:16:47 2.53 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: aniso.c,v 2.50 2010/10/13 15:29:02 greg Exp $"; +static const char RCSid[] = "$Id: aniso.c,v 2.53 2012/06/09 07:16:47 greg Exp $"; #endif /* * Shading functions for anisotropic materials. @@ -277,10 +277,9 @@ m_aniso( /* shade ray that hit something anisotropic if (nd.rdiff > FTINY) { /* ambient from this side */ copycolor(ctmp, nd.mcolor); /* modified by material color */ - if (nd.specfl & SP_RBLT) - scalecolor(ctmp, 1.0-nd.trans); - else - scalecolor(ctmp, nd.rdiff); + scalecolor(ctmp, nd.rdiff); + if (nd.specfl & SP_RBLT) /* add in specular as well? */ + addcolor(ctmp, nd.scolor); multambient(ctmp, r, nd.pnorm); addcolor(r->rcol, ctmp); /* add to returned color */ } @@ -326,8 +325,8 @@ getacoords( /* set up coordinate system */ np->specfl |= SP_BADU; return; } - if (mf->f != &unitxf) - multv3(np->u, np->u, mf->f->xfm); + if (mf->fxp != &unitxf) + multv3(np->u, np->u, mf->fxp->xfm); fcross(np->v, np->pnorm, np->u); if (normalize(np->v) == 0.0) { objerror(np->mp, WARNING, "illegal orientation vector"); @@ -367,7 +366,7 @@ agaussamp( /* sample anisotropic Gaussian specular */ nstarget = 1; } setcolor(scol, 0., 0., 0.); - dimlist[ndims++] = (int)np->mp; + dimlist[ndims++] = (int)(size_t)np->mp; maxiter = MAXITER*nstarget; for (nstaken = ntrials = 0; nstaken < nstarget && ntrials < maxiter; ntrials++) { @@ -437,7 +436,7 @@ agaussamp( /* sample anisotropic Gaussian specular */ } else nstarget = 1; } - dimlist[ndims++] = (int)np->mp; + dimlist[ndims++] = (int)(size_t)np->mp; maxiter = MAXITER*nstarget; for (nstaken = ntrials = 0; nstaken < nstarget && ntrials < maxiter; ntrials++) {