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

Comparing ray/src/rt/normal.c (file contents):
Revision 2.78 by greg, Wed Feb 13 01:00:31 2019 UTC vs.
Revision 2.80 by greg, Fri Apr 19 19:01:32 2019 UTC

# Line 262 | Line 262 | m_normal(                      /* color a ray that hit something normal *
262                  }
263          } else
264                  nd.tdiff = nd.tspec = nd.trans = 0.0;
265 +                                                /* diffuse reflection */
266 +        nd.rdiff = 1.0 - nd.trans - nd.rspec;
267                                                  /* transmitted ray */
266
268          if ((nd.specfl&(SP_TRAN|SP_PURE|SP_TBLT)) == (SP_TRAN|SP_PURE)) {
269                  RAY  lr;
270                  copycolor(lr.rcoef, nd.mcolor); /* modified by color */
# Line 279 | Line 280 | m_normal(                      /* color a ray that hit something normal *
280                                  copycolor(r->mcol, lr.mcol);
281                                  r->rmt = r->rot + lr.rmt;
282                                  r->rxt = r->rot + lr.rxt;
283 <                        } else
283 >                        } else if (nd.tspec > nd.tdiff + nd.rdiff)
284                                  r->rxt = r->rot + raydistance(&lr);
285                  }
286          }
# Line 320 | Line 321 | m_normal(                      /* color a ray that hit something normal *
321                          multcolor(lr.rcol, lr.rcoef);
322                          copycolor(r->mcol, lr.rcol);
323                          addcolor(r->rcol, lr.rcol);
324 +                        r->rmt = r->rot;
325                          if (nd.specfl & SP_FLAT &&
326                                          !hastexture | (r->crtype & AMBIENT))
327 <                                r->rmt = r->rot + raydistance(&lr);
327 >                                r->rmt += raydistance(&lr);
328                  }
329          }
328                                                /* diffuse reflection */
329        nd.rdiff = 1.0 - nd.trans - nd.rspec;
330  
331          if (nd.specfl & SP_PURE && nd.rdiff <= FTINY && nd.tdiff <= FTINY)
332                  return(1);                      /* 100% pure specular */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines