Fix perspective in normal view.

This commit is contained in:
Vincent Lejeune 2014-08-09 21:19:26 +02:00
parent c07aed260a
commit c546b25ae9

View File

@ -12,7 +12,9 @@ void main()
EmitVertex();
vec3 normal = nor[i];
gl_Position = pos + .2 * vec4(normal, 0.);
pos = inverse(ProjectionMatrix) * pos;
pos /= pos.w;
gl_Position = ProjectionMatrix * (pos + .2 * vec4(normal, 0.));
EmitVertex();
EndPrimitive();