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.84 by greg, Fri Apr 5 01:10:26 2024 UTC vs.
Revision 2.85 by greg, Thu Dec 5 19:23:43 2024 UTC

# Line 56 | Line 56 | typedef struct {
56          short  specfl;          /* specularity flags, defined above */
57          SCOLOR  mcolor;         /* color of this material */
58          SCOLOR  scolor;         /* color of specular component */
59        FVECT  vrefl;           /* vector in direction of reflected ray */
59          FVECT  prdir;           /* vector in transmitted direction */
60          double  alpha2;         /* roughness squared */
61          double  rdiff, rspec;   /* reflected specular, diffuse */
# Line 304 | Line 303 | m_normal(                      /* color a ray that hit something normal *
303                                                  /* check threshold */
304                  if (!(nd.specfl & SP_PURE) && specthresh >= nd.rspec-FTINY)
305                          nd.specfl |= SP_RBLT;
307                                                /* compute reflected ray */
308                VSUM(nd.vrefl, r->rdir, nd.pnorm, 2.*nd.pdot);
309                                                /* penetration? */
310                if (hastexture && DOT(nd.vrefl, r->ron) <= FTINY)
311                        VSUM(nd.vrefl, r->rdir, r->ron, 2.*r->rod);
312                checknorm(nd.vrefl);
306          }
307                                                  /* reflected ray */
308          if ((nd.specfl&(SP_REFL|SP_PURE|SP_RBLT)) == (SP_REFL|SP_PURE)) {
309                  RAY  lr;
310                  if (rayorigin(&lr, REFLECTED, r, nd.scolor) == 0) {
311 <                        VCOPY(lr.rdir, nd.vrefl);
311 >                                                /* compute reflected ray */
312 >                        VSUM(lr.rdir, r->rdir, nd.pnorm, 2.*nd.pdot);
313 >                                                /* penetration? */
314 >                        if (hastexture && DOT(lr.rdir, r->ron) <= FTINY)
315 >                                VSUM(lr.rdir, r->rdir, r->ron, 2.*r->rod);
316 >                        checknorm(lr.rdir);
317                          rayvalue(&lr);
318                          smultscolor(lr.rcol, lr.rcoef);
319                          copyscolor(r->mcol, lr.rcol);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines