Part of the Khronos Group

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: GL_TRIANGLE_STRIP to GL_PATCHES (as input of tesselator control shader)

  1. #1
    Junior Member Regular Contributor execom_rt's Avatar
    Join Date
    Jul 2000

    GL_TRIANGLE_STRIP to GL_PATCHES (as input of tesselator control shader)

    Is there a fast way to call glDrawElements with GL_PATCHES while providing a 'triangle strip' list of indices ?

    Right now I have to convert my triangle strip to triangles list because there is now way to tell the OpenGL Tesselator Control shader that my drawElements call is triangle strip list and not a triangle list.


    • layout(vertices=3) out;
    • layout(triangles, fractional_odd_spacing, ccw) in;
    • glPatchParameteri( GL_PATCH_VERTICES, 3);
    • glDrawElements(GL_PATCHES, ...) with indices as an existing triangle stripped object.


  2. #2
    Member Regular Contributor malexander's Avatar
    Join Date
    Aug 2009
    There is no GL_PATCH_STRIP, so I believe the easiest way to avoid duplicating your vertex data is to build an equivalent element list of { 0,1,2, 2,1,3, 2,3,4, 4,3,5... } for your strip.

  3. #3
    Senior Member OpenGL Pro
    Join Date
    Jan 2012
    I think you have missed the point of a patch. It is just a set of data - they are not triangles/lines or anything special. It is the shader that actually decides what the data represents. For example a patch vertex may define a sphere or a cylinder that is constructed in the tessellation stage or a set of vertices may be knots for a nurb surface.

Tags for this Thread

Posting Permissions

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