Skip to content

Commit

Permalink
fix: Was over-estimating diffuse reflection with Fresnel effect
Browse files Browse the repository at this point in the history
  • Loading branch information
Gregungory committed Dec 11, 2024
1 parent 5d6c03d commit 263f893
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/rt/m_wgmdf.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef lint
static const char RCSid[] = "$Id: m_wgmdf.c,v 2.2 2024/12/10 03:16:13 greg Exp $";
static const char RCSid[] = "$Id: m_wgmdf.c,v 2.3 2024/12/11 17:34:03 greg Exp $";
#endif
/*
* Shading function for programmable Ward-Geisler-Moroder-Duer material.
Expand Down Expand Up @@ -538,6 +538,7 @@ m_wgmdf(OBJREC *m, RAY *r)
const double fest = FRESNE(fabs(wd.rs.mo.pdot));
for (i = NCSAMP; i--; )
wd.rs.scol[i] += fest*(1. - wd.rs.scol[i]);
scalecolor(wd.rd.scol, 1.-fest);
scalescolor(wd.ts.scol, 1.-fest);
scalescolor(wd.td.scol, 1.-fest);
}
Expand Down

0 comments on commit 263f893

Please sign in to comment.