Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: How to get wireframe display of a mesh using GLSL?

  1. #1
    Intern Contributor
    Join Date
    Jun 2009
    Posts
    50

    How to get wireframe display of a mesh using GLSL?

    Hello,

    How to display the wireframe for a given mesh using GLSL?

    Thanks

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Jan 2012
    Location
    Australia
    Posts
    785
    call glPolyMode(GL_FRONT_AND_BACK,GL_LINE);

  3. #3
    Member Regular Contributor malexander's Avatar
    Join Date
    Aug 2009
    Location
    Ontario
    Posts
    257
    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.

  4. #4
    Junior Member Regular Contributor Nowhere-01's Avatar
    Join Date
    Feb 2011
    Location
    Novosibirsk
    Posts
    192
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •