Hello,
How to display the wireframe for a given mesh using GLSL?
Thanks
Hello,
How to display the wireframe for a given mesh using GLSL?
Thanks
call glPolyMode(GL_FRONT_AND_BACK,GL_LINE);
Using line fill polygon mode will work great for triangulated meshes.
However, if you're making a mesh out of quads, you'll need a different approach, as GL_LINES will also draw the diagonal of the quad. One way around this is to create an element list with a primitive restart index (v0 v1 v2 v3 RS...) and draw with GL_LINE_LOOP.
You may need to use geometry shaders to have better control and draw any kind of convex polygon, some tutorial(shader examples are at the bottom):
http://cgg-journal.com/2008-2/06/index.html
I am a star's ray through billions of years
Piercing through the weakness of optic nerve
I am the blade of shining "no"
Ripping up the pregnancy of joy