# What to do with unused vertices?

Imagine yourself a vertex array in OpenGL representing blocks in a platform game.

But some vertices may be not used.

The environment is dynamic, so there always some vertex may suddenly become invisible.

What is the best way to make them not draw? Graphic cards are complicated and it's hard to predict what is best approach.

Few best ways I can think of:

1. delete and move all vertices after deleted one to fill freed space (sounds extremely inefficient)
2. set positions to 0
3. set transparency to maximum

I could of course benchmark, but what on my computer works faster doesn't have to on other.

• Why a down vote? – Franz Wexler Dec 29 '16 at 18:57
• Why not: only write out the vertices for blocks that actually exist? – user253751 Jan 4 '17 at 2:53
• @immibis Blocks can be added between existing blocks and existing blocks can be removed. Blocks would quickly become placed in random indices in array or I would need to move lots of data. – Franz Wexler Jan 5 '17 at 16:10

Just don't draw them.

For example, if you have 3 quads in a buffer, and you only wish to draw quads 0 and 2:

glDrawArrays (GL_QUADS, 0, 4);