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,

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.

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?

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.

Yeah it’s required. :slight_smile:

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?

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.

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).