solstice-solver

Solver library of the solstice app
git clone git://git.meso-star.com/solstice-solver.git
Log | Files | Refs | README | LICENSE

commit cfb23b462b7599476369d8aa8187addcfe824bfc
parent 6c7c77879c1ac71fb1f9caccdfd2e4e535082ea8
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Thu,  6 Apr 2017 17:01:27 +0200

Fix the surface_fragment setup

Partial derivatives might be wrongly defined.

Diffstat:
Msrc/ssol.h | 2+-
Msrc/ssol_material.c | 3+--
2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/ssol.h b/src/ssol.h @@ -247,8 +247,8 @@ struct ssol_surface_fragment { double uv[2]; /* Texture coordinates */ double dPdu[3]; /* Partial derivative of the position in u */ double dPdv[3]; /* Partial derivative of the position in v */ - }; + #define SSOL_SURFACE_FRAGMENT_NULL__ \ {{0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0}, {0,0,0}, {0,0,0}} static const struct ssol_surface_fragment SSOL_SURFACE_FRAGMENT_NULL = diff --git a/src/ssol_material.c b/src/ssol_material.c @@ -545,9 +545,8 @@ surface_fragment_setup dP2[0] = P[2].value[0] - P[0].value[0]; dP2[1] = P[2].value[1] - P[0].value[1]; dP2[2] = P[2].value[2] - P[0].value[2]; - det = duv1[0]*duv2[1] - duv1[1]*duv2[0]; - if(det <= 0) { /* Handle zero determinant */ + if(det == 0) { /* Handle zero determinant */ double basis[9]; d33_basis(basis, fragment->Ng); d3_set(fragment->dPdu, basis + 0);