From 263f89374913a666a33a338c83ae66fe791ad370 Mon Sep 17 00:00:00 2001 From: "Gregory J. Ward" Date: Wed, 11 Dec 2024 17:34:03 +0000 Subject: [PATCH] fix: Was over-estimating diffuse reflection with Fresnel effect --- src/rt/m_wgmdf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/rt/m_wgmdf.c b/src/rt/m_wgmdf.c index 14e66d6f..cc2db246 100644 --- a/src/rt/m_wgmdf.c +++ b/src/rt/m_wgmdf.c @@ -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. @@ -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); }