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.85 by greg, Thu Dec 5 19:23:43 2024 UTC vs.
Revision 2.87 by greg, Fri Dec 20 16:29:50 2024 UTC

# Line 134 | Line 134 | dirnorm(               /* compute source contribution */
134                  dtmp = np->alpha2;
135                                                  /* + source if flat */
136                  if (np->specfl & SP_FLAT)
137 <                        dtmp += omega * (0.25/PI);
137 >                        dtmp += (1. - dstrsrc) * omega * (0.25/PI);
138                                                  /* half vector */
139                  VSUB(vtmp, ldir, np->rp->rdir);
140                  d2 = DOT(vtmp, np->pnorm);
# Line 225 | Line 225 | m_normal(                      /* color a ray that hit something normal *
225                  VCOPY(nd.pnorm, r->ron);
226                  nd.pdot = r->rod;
227          }
228 <        if (r->ro != NULL && isflat(r->ro->otype))
228 >        if (!hastexture && r->ro != NULL && isflat(r->ro->otype))
229                  nd.specfl |= SP_FLAT;
230          if (nd.pdot < .001)
231                  nd.pdot = .001;                 /* non-zero for dirnorm() */
# Line 319 | Line 319 | m_normal(                      /* color a ray that hit something normal *
319                          copyscolor(r->mcol, lr.rcol);
320                          saddscolor(r->rcol, lr.rcol);
321                          r->rmt = r->rot;
322 <                        if (nd.specfl & SP_FLAT &&
323 <                                        !hastexture | (r->crtype & AMBIENT))
322 >                        if (nd.specfl & SP_FLAT && r->crtype & AMBIENT)
323                                  r->rmt += raydistance(&lr);
324                  }
325          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines