This project demonstrates how to use glPrimitiveRestartIndex to draw different lines of different lengths using the SimpleIndexVAO class
The PrimRestartLine.py uses the build in PyNGL elements for ease but the update is slow.
The FasterVersion.py uses buffer created using Numpy to make things quicker, it also uses raw OpenGL commands to generate an Element Buffer Object
- OpenGL Wiki — Vertex Rendering: Primitive Restart — how the restart index splits one indexed draw into many strips/lines.
- glPrimitiveRestartIndex — OpenGL Reference — the API used here.
- OpenGL Wiki — Buffer Object Streaming — why the NumPy/raw-EBO
FasterVersion.pybeats per-frame rebuilds.
