GLPATCHPARAMETER(3G)

πŸ’… GLPATCHPARAMETER β€” glPatchParameter πŸ’…

okay bestie, so this is a 3G manpage (that's the GL one, iykyk) and it's literally all about telling OpenGL how your patch primitives should behave. tessellation girlies rise πŸ¦‹


✨ C SPECIFICATION ✨

void glPatchParameteri(GLenum pname, GLint value);

void glPatchParameterfv(GLenum pname, const GLfloat *values);

πŸŽ€ PARAMETERS πŸŽ€

  • pname β€” the name of the parameter you're setting, bestie. it has to be one of these symbolic constants: GL_PATCH_VERTICES, GL_PATCH_DEFAULT_OUTER_LEVEL, or GL_PATCH_DEFAULT_INNER_LEVEL.
  • value β€” the shiny new value for whatever pname you picked. πŸ’–
  • values β€” the address of an array holding the new values for the parameter named by pname. yes, address of an array, not the array itself, she's ✨fancy✨

🌸 DESCRIPTION 🌸

glPatchParameter sets the parameters that get used for patch primitives. pname says which one you're modifying and it must be either GL_PATCH_VERTICES, GL_PATCH_DEFAULT_OUTER_LEVEL, or GL_PATCH_DEFAULT_INNER_LEVEL. for glPatchParameteri, value is the new value for the parameter in pname. for glPatchParameterfv, values is the address of an array carrying the new values for the parameter in pname.

when pname is GL_PATCH_VERTICES, value says how many vertices go into making up a single patch primitive. patch primitives get eaten by the tessellation control shader (if there is one) and then used for tessellation. when primitives are specified with glDrawArrays() or a similar function, each patch is made from parameter control points, each one represented by a vertex taken from the enabled vertex arrays. parameter has to be greater than zero, and less than or equal to the value of GL_MAX_PATCH_VERTICES. no cap? actually there IS a cap, sorry babe πŸ’€

when pname is GL_PATCH_DEFAULT_OUTER_LEVEL or GL_PATCH_DEFAULT_INNER_LEVEL, values holds the address of an array containing the default outer or inner tessellation levels (respectively) to be used when there's no tessellation control shader present. main character fallback behaviour honestly πŸ‘‘


πŸ”₯ ERRORS πŸ”₯

  • GL_INVALID_ENUM β€” thrown when pname isn't one of the accepted values. wrong name, wrong vibe, denied.
  • GL_INVALID_VALUE β€” thrown when pname is GL_PATCH_VERTICES and value is less than or equal to zero, or greater than the value of GL_MAX_PATCH_VERTICES. (yes, both bounds. she checks both. πŸ™ˆ)

πŸ‘‘ VERSION SUPPORT πŸ‘‘

so the original page ships a whole grid for this β€” I can't do tables in here so here's the tea in list form, same numbers, same ticks, no cap:

  • glPatchParameterfv β€” OpenGL 2.0: -, 2.1: -, 3.0: -, 3.1: -, 3.2: -, 3.3: -, then 4.0: βœ”, 4.1: βœ”, 4.2: βœ”, 4.3: βœ”, 4.4: βœ”, 4.5: βœ”
  • glPatchParameteri β€” OpenGL 2.0: -, 2.1: -, 3.0: -, 3.1: -, 3.2: -, 3.3: -, then 4.0: βœ”, 4.1: βœ”, 4.2: βœ”, 4.3: βœ”, 4.4: βœ”, 4.5: βœ”

so like... 4.0 and up only, both of them. thx for coming to my TED talk 🫢


⭐ SEE ALSO ⭐

go read these next, they're the friend group:

  • glDrawArrays()
  • glDrawArraysInstanced()
  • glDrawElements()
  • glDrawRangeElements()

Copyright Β© 2010-2014 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/.

Copyright Β© 2010-2014 Khronos Group.


okay that's the whole page πŸ’… and for the sign-off: this little icon came from [FIXME: source] and it's dated 08/09/2021 β€” so go forth and tessellate, bestie. slay, periodt, and may your GL_MAX_PATCH_VERTICES never betray you πŸŒˆβœ¨πŸŽ€

πŸ“¦ where this page comes from