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 6 of 6

Thread: Rendering High Order Bezier Patches

  1. #1
    Junior Member Newbie
    Join Date
    Mar 2012
    Posts
    15

    Rendering High Order Bezier Patches

    Hey,
    What would be the best way to render a high order bezier patch? As there is a limit on number of control points per patch, do we need to segment the whole bezier patch?

    Thanks and Regards,

  2. #2
    Junior Member Regular Contributor malexander's Avatar
    Join Date
    Aug 2009
    Location
    Ontario
    Posts
    246

    Re: Rendering High Order Bezier Patches

    If you're using a GL4 tessellation shader to render the patch, then there is a limit to the number of points in the patch. I believe it's 32 vertices, but check GL_MAX_PATCH_VERTICES.

  3. #3
    Junior Member Newbie
    Join Date
    Mar 2012
    Posts
    15

    Re: Rendering High Order Bezier Patches

    Yes, I know that. We only can have 32 vertices in a patch. But what if I have more than 32 vertices, is there any approach to render the bezier surface still as if it looks like the whole original patch rendered at once?

  4. #4
    Junior Member Regular Contributor malexander's Avatar
    Join Date
    Aug 2009
    Location
    Ontario
    Posts
    246

    Re: Rendering High Order Bezier Patches

    Sorry, read "As" as "Is". More caffeine required on Monday mornings.

    You can send the large patch as several subpatches, each 4x4 (assuming a bezier of order 4). With an element buffer to do the vertex indexing, you can just send the points of the large surface once, wire up all the subpatches in the element buffer, and send the whole surface in one glDrawElements() call.

  5. #5
    Junior Member Newbie
    Join Date
    Mar 2012
    Posts
    15

    Re: Rendering High Order Bezier Patches

    Yeah it's required.

    I think in element buffer, I can do indexing for a currently bind buffer. And does this GL_MAX_PATCH_VERTICES limit not apply on the count parameter of glDrawElements() or not?

    Code :
    glPatchParameteri(GL_PATCH_VERTICES, 16);
    glDrawElements(GL_PATCHES, 16, GL_UNSIGNED_INT, 0);

    Can you be please more explicit? It's still not clear to me.

  6. #6
    Junior Member Newbie
    Join Date
    Mar 2012
    Posts
    15

    Re: Rendering High Order Bezier Patches

    The approach I got is just to send your all data with Texture Buffers and it works perfectly fine. For each surface you just need to send a quad (4 control points patch).

Posting Permissions

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