GL_PRIMITIVEIDIN(3G)

πŸ’– NAME πŸ’–

Okay bestie, welcome to the GL_PRIMITIVEIDIN(3G) manual page. The main character here is gl_PrimitiveIDIn β€” it contains the index of the current primitive. That’s the whole vibe. πŸ’…


🧚 DECLARATION 🧚

Here’s the exact lil signature, no cap:

in int gl_PrimitiveIDIn ;

🌸 DESCRIPTION 🌸

gl_PrimitiveIDIn is a geometry language input variable that holds the number of primitives processed by the shader since the current set of rendering primitives was started. The first primitive processed by the drawing command is numbered zero, and the primitive ID counter is incremented after every individual point, line or triangle primitive is processed.

For triangles drawn in point or line mode, the primitive ID counter is incremented only once, even though multiple points or lines may actually be drawn. And restarting a primitive topology using the primitive restart index has no effect on the primitive ID counter. Periodt.


✨ VERSION SUPPORT ✨

Support vibe check for the gl_PrimitiveIDIn variable name across OpenGL Shading Language versions:

  • 1.10: -
  • 1.20: -
  • 1.30: -
  • 1.40: -
  • 1.50: βœ”
  • 3.30: βœ”
  • 4.00: βœ”
  • 4.10: βœ”
  • 4.20: βœ”
  • 4.30: βœ”
  • 4.40: βœ”
  • 4.50: βœ”

πŸ‘€ SEE ALSO πŸ‘€

You already know we gotta shout out gl_InstanceID() too. Go peek, bestie. 🫢


Copyright Β© 2011-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 Β© 2011-2014 Khronos Group


Bye bestie πŸ’– β€” signing off from the [FIXME: source] version, dated 08/09/2021, manual GL_PRIMITIVEIDIN(3G). Stay iconic. ✨

πŸ“¦ where this page comes from