0
\$\begingroup\$

I'm following the amazing LearnOpenGL tutorials and noticed that Element Buffer Objects, which were mentioned and used in the Hello Triangle chapter, never appear again. So my question is, is using Element Buffer Objects good practice and/or does it provide a performance advantage over just specifying the data for each Vertex manually? I'm very curious about this, and any information would be helpful. Thank you for your time!

\$\endgroup\$
3
  • 1
    \$\begingroup\$ are you talking about GL_ELEMENT_ARRAY_BUFFER? Those are buffers that contain vertex indices. They are very important for indexed drawing. \$\endgroup\$
    – Raildex
    Commented Mar 20, 2023 at 11:17
  • \$\begingroup\$ @Raildex Yeah, I should probably edit my post to specify what I actually mean. \$\endgroup\$ Commented Mar 20, 2023 at 17:49
  • \$\begingroup\$ Yes, you should. Do that. \$\endgroup\$
    – DMGregory
    Commented Mar 28, 2023 at 16:13

1 Answer 1

0
\$\begingroup\$

EBOs are memory efficient. i.e: It takes you 8 floats to define a basic square instead of 12. For 2D games you could get away with VBOs only, however, the efficiency becomes apparent in 3D where you have 100,000ths polygons to render each frame.

\$\endgroup\$
2
  • \$\begingroup\$ Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center. \$\endgroup\$
    – liggiorgio
    Commented Mar 28, 2023 at 15:37
  • \$\begingroup\$ Thanks for the advice and link! I don't think documentation is necessary in this case though. It's simple stuff :D. If there is more to add to my answer, I appreciate another set of eyes! \$\endgroup\$ Commented Mar 28, 2023 at 23:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .