I'm trying to make wide line with width > 10px using this topic as example https://forum.libcinder.org/topic/smooth-thick-lines-using-geometry-shader. But i'm stuck with a problem: trivial perspective division
gl_Position = vec4(gl_PositionIn[0].xy/gl_PositionIn[0].w + width, 0, 1);
gives me undesireable behavior for vertecies in front of near plane (w < 0).
Is it possible to calculate correct screen space coordinates for these vertices? Alternatively coordinates can be calculated as
float w = 1.0;
if(gl_PositionIn[0].w < 0)
w = - 1.0;
gl_Position = vec4(gl_PositionIn[0].xy/abs(w) + width, 0, w);
However it makes line perspective, but i want line to be constant wide. Can it help to disable perspective interpolation for gl_Position? Is it some way to disable (or compensate) it in #version 120 shader?