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?

Hybrid View

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

    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
    Senior Member OpenGL Pro
    Join Date
    Jan 2012
    Location
    Australia
    Posts
    1,117
    call glPolyMode(GL_FRONT_AND_BACK,GL_LINE);

  3. #3
    Member Regular Contributor malexander's Avatar
    Join Date
    Aug 2009
    Location
    Ontario
    Posts
    320
    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
    Member Regular Contributor Nowhere-01's Avatar
    Join Date
    Feb 2011
    Location
    Novosibirsk
    Posts
    251
    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

Posting Permissions

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