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.79 by greg, Wed Feb 13 02:38:26 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 325 | Line 326 | m_normal(                      /* color a ray that hit something normal *
326                                  r->rmt = r->rot + raydistance(&lr);
327                  }
328          }
328                                                /* diffuse reflection */
329        nd.rdiff = 1.0 - nd.trans - nd.rspec;
329  
330          if (nd.specfl & SP_PURE && nd.rdiff <= FTINY && nd.tdiff <= FTINY)
331                  return(1);                      /* 100% pure specular */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines