ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/aniso.c
(Generate patch)

Comparing ray/src/rt/aniso.c (file contents):
Revision 2.28 by greg, Wed Dec 21 09:51:44 1994 UTC vs.
Revision 2.31 by greg, Wed Nov 22 09:27:51 1995 UTC

# Line 263 | Line 263 | register RAY  *r;
263                                                  /* diffuse reflection */
264          nd.rdiff = 1.0 - nd.trans - nd.rspec;
265  
266 <        if (r->ro != NULL && (r->ro->otype == OBJ_FACE ||
267 <                        r->ro->otype == OBJ_RING))
266 >        if (r->ro != NULL && isflat(r->ro->otype))
267                  nd.specfl |= SP_FLAT;
268  
269          getacoords(r, &nd);                     /* set up coordinates */
# Line 273 | Line 272 | register RAY  *r;
272                  agaussamp(r, &nd);
273  
274          if (nd.rdiff > FTINY) {         /* ambient from this side */
275 <                ambient(ctmp, r);
275 >                ambient(ctmp, r, nd.pnorm);
276                  if (nd.specfl & SP_RBLT)
277                          scalecolor(ctmp, 1.0-nd.trans);
278                  else
# Line 282 | Line 281 | register RAY  *r;
281                  addcolor(r->rcol, ctmp);        /* add to returned color */
282          }
283          if (nd.tdiff > FTINY) {         /* ambient from other side */
284 +                FVECT  bnorm;
285 +
286                  flipsurface(r);
287 <                ambient(ctmp, r);
287 >                bnorm[0] = -nd.pnorm[0];
288 >                bnorm[1] = -nd.pnorm[1];
289 >                bnorm[2] = -nd.pnorm[2];
290 >                ambient(ctmp, r, bnorm);
291                  if (nd.specfl & SP_TBLT)
292                          scalecolor(ctmp, nd.trans);
293                  else

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines