commit 5cebd9d1526ff0ba6e18d593a1f992b646049361
parent ccce44976b7332a6e89a65e718e8c60db8e3139c
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Fri, 2 Jul 2021 11:59:01 +0200
Fix the RDG-FA evaluation function
Diffstat:
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/ssf_phase_rdgfa.c b/src/ssf_phase_rdgfa.c
@@ -240,9 +240,13 @@ static double
rdgfa_eval(void* data, const double wo[3], const double wi[3])
{
const struct rdgfa* rdgfa = data;
- const double cos_theta = d3_dot(wo, wi);
- const double theta = acos(cos_theta);
+ double cos_theta, theta;
+ double v[3];
ASSERT(d3_is_normalized(wo) && d3_is_normalized(wi));
+
+ d3_minus(v, wo);
+ cos_theta = d3_dot(v, wi);
+ theta = acos(cos_theta);
return eval2(data, theta, cos_theta) * rdgfa->rcp_normalize_factor;
}