Fixed glViewer triangle normal calculation

The normal computed for primitive triangles had a flipped
orientation in the glViewer, This caused linear approximating
patches to be shaded incorrectly for adaptively refined Loop
meshes, and similarly triangles resulting from uniformly refined
Loop meshes.
This commit is contained in:
David G Yu 2019-06-17 16:56:10 -07:00
parent db9c01e7e0
commit 973b7fe7a5

View File

@ -324,8 +324,8 @@ void main()
#endif // PRIM_QUAD
#ifdef PRIM_TRI
vec3 A = (inpt[1].v.position - inpt[0].v.position).xyz;
vec3 B = (inpt[2].v.position - inpt[0].v.position).xyz;
vec3 A = (inpt[0].v.position - inpt[1].v.position).xyz;
vec3 B = (inpt[2].v.position - inpt[1].v.position).xyz;
vec3 n0 = normalize(cross(B, A));
#if defined(GEOMETRY_OUT_WIRE) || defined(GEOMETRY_OUT_LINE)