Line width + fragment shader + NEON effect

Dear OpenGL GURUes

I have a question about line width, point size, and fragment shader execution

I wanted to implement the NEON effect on “lines”… so, for each vertex,
I pass as attribute a second vertex, and then I can build a line equation
on the shader…with the line equation I can compute the distance from
the fragment to the center line, and take the correct color

However, I found that only the fragments of the center line are
generated… thus, the distance is always about cero… and the resulting
fragment color is replicated in all the pixels along the width of the line :frowning:

If it is true, then… it seems like I have to implement the NEON effect in image
post-processing step instead … which makes me a bit sad…

I am taking the right way, or I am wrong?

Thank you

Line width is controlled by glLineWidth, but the set of supported widths is implementation-dependent. Only a width of 1 is guaranteed to be supported. Even if wide lines are supported, OpenGL’s line rasterisation doesn’t support joins, so there will be noticeable gaps at the vertices for widths much larger than 1.

If you want wide lines with joins, use a geometry shader with an input type of GL_LINES_ADJACENCY to convert each line segment to a pair of triangles.

Yeah…I see…

Also, we can generate a circle at the end points for rounded joints.-…
Thank you