Instanced Arrays

I was just checking out the Mac Developer Library and noticed a really cool sample code project, "InstancedArrays".

Here's the description:

"A common use case in OpenGL is to be able to draw a group of similar objects that share vertex data, primitive count and type, multiple times. The ARB_instanced_arrays extension provides a means of accelerating such use cases while minimizing the number of draw calls and the amount of duplicate data. This extension introduces an array "divisor" for generic vertex array attributes, which when non-zero specifies that the attribute is "instanced". An instanced attribute does not advance per-vertex as usual, but rather after every instances are rendered.


This sample demonstrates how to use instancing. By specifying transform data in instanced attributes, one can, in concert with the instancing draw call, draw multiple instances of an object with one draw call."

This shows how most of the typical boilerplate involved setting up a Core Profile OpenGL using app, loading shaders, and rendering multiple similar objects efficiently. It also incidentally shows some of the GLKit convenience functions. I'd kinda rather see that stuff setup without that, but not really a big deal.

I don't know if this link will be active if not logged into a developer account, but I'd guess it will work:

https://developer.apple.com/library/mac/samplecode/InstancedArrays/Introduction/Intro.html#//apple_ref/doc/uid/DTS40010090