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

Comparing ray/src/rt/m_wgmdf.c (file contents):
Revision 2.7 by greg, Wed Dec 18 18:34:13 2024 UTC vs.
Revision 2.10 by greg, Fri May 23 17:09:26 2025 UTC

# Line 256 | Line 256 | set_scomp(WGMDDAT *wp, int trans)
256          if (normalize(sp->v) == 0.0) {  /* orientation vector==normal? */
257                  if (fabs(sp->u_alpha - sp->v_alpha) > 0.001)
258                          objerror(wp->mtp, WARNING, "bad orientation vector");
259 <                getperpendicular(sp->u, sp->mo.pnorm, 1);       /* punting */
259 >                getperpendicular(sp->u, sp->mo.pnorm, 0);       /* punting */
260                  fcross(sp->v, sp->mo.pnorm, sp->u);
261                  sp->u_alpha = sp->v_alpha = sqrt( 0.5 *
262                          (sp->u_alpha*sp->u_alpha + sp->v_alpha*sp->v_alpha) );
# Line 452 | Line 452 | dirwgmdf(SCOLOR scval, void *uwp, FVECT ldir, double o
452                   */
453                                                  /* add source width if flat */
454                  if (wp->specfl & SP_FLAT)
455 <                        au2 = av2 = omega * (0.25/PI);
455 >                        au2 = av2 = (1. - dstrsrc) * omega * (0.25/PI);
456                  else
457                          au2 = av2 = 0.0;
458                  au2 += wp->rs.u_alpha*wp->rs.u_alpha;
# Line 553 | Line 553 | m_wgmdf(OBJREC *m, RAY *r)
553                  return(1);              /* second shadow test */
554          set_dcomp(&wd, 1);
555          set_scomp(&wd, 0);
556 <        wd.specfl |= SP_FLAT*(r->ro != NULL && isflat(r->ro->otype));
556 >        wd.specfl |= SP_FLAT*(!wd.rs.mo.hastexture &&
557 >                                r->ro != NULL && isflat(r->ro->otype));
558                                          /* apply Fresnel adjustments? */
559          if (wd.specfl & SP_RPURE && pbright(wd.rs.scol) >= FRESTHRESH) {
560                  const double    fest = FRESNE(fabs(wd.rs.mo.pdot));
# Line 612 | Line 613 | m_wgmdf(OBJREC *m, RAY *r)
613                  copyscolor(r->mcol, lr.rcol);
614                  saddscolor(r->rcol, lr.rcol);
615                  r->rmt = r->rot;
616 <                if (wd.specfl & SP_FLAT &&
616 <                                !wd.rs.mo.hastexture | (r->crtype & AMBIENT))
616 >                if (wd.specfl & SP_FLAT && r->crtype & AMBIENT)
617                          r->rmt += raydistance(&lr);
618          }
619          if (wd.specfl & (SP_REFL|SP_TRAN))      /* specularly scattered rays */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines