Edges on mesh

Hello everyone!

I’m trying to use the Shaders to visualize a (large) Finite Elements mesh.
I use an indecies buffer to reduce memory usage.

Besides drawing faces I also need to draw edges with another color.
The only way I see to do it is using GS or declinig indecies.

Is still there any way to detect edges in the PS without using GS or declinig indexes?

Thanks in advance!


Yes, that is the thing I need. But how can I

Thus, for each vertex of, say, a triangle we must send the other two vertices as attributes in order to compute the line distance
without GS if I use index buffer? How can I access the other two vertices within VS?

Check out the NV SDK. They have a sample that implements something along these lines as I recall.