Add hard edge to non-visible areas

This commit is contained in:
2021-06-30 13:52:14 +02:00
parent 1cfd1663d1
commit 532f491327
10 changed files with 68 additions and 56 deletions
+2 -2
View File
@@ -3,14 +3,14 @@ layout (lines_adjacency) in;
layout (triangle_strip, max_vertices = 4) out;
layout (std140, binding = 0) uniform TheMat { mat4 theMat; } ;
uniform vec3 lightPos;
vec4 shift (vec4 p) { return (vec4 (p.xyz + (2000*(p.xyz-lightPos)), 1));}
vec4 shift (vec4 p) { return (vec4 (p.xyz + (1000*(p.xyz-lightPos)), 1));}
vec4 f (vec4 p) {return (theMat * p);}
void main()
{
vec4 p0 = gl_in[0].gl_Position;
vec3 n0 = gl_in[2].gl_Position.xyz;
vec3 n1 = gl_in[3].gl_Position.xyz;
vec3 n2 = n0 + n1; // assumes the summands are normalized
//vec3 n2 = n0 + n1; // assumes the summands are normalized
vec3 lightDir = p0.xyz - lightPos.xyz;
// first test if the edge is part of the silhouette
// that is, if the normals of the faces connected by the edge point in