I am trying to switch over a large portion of my current project to instanced rendering. I can’t, however, find reliable documentation on how to apply it to rendering multiple copies of the same model. Would anyone know of any examples/tutorials/pdfs floating around on the internet?
There’s no setup for it, all you do is call [icode]glDraw*Instanced[/icode] with instancecount set to how many copies you want. That’s all.
When using instanced rendering with shaders, you can also have attributes that are unique per instance instead of per vertex using [icode]glVertexAttribDivisor[/icode].
If you need more documentation on these functions, a simple google search with just the function name should yield you with an opengl.org site.
Ah, it’s the attribute divisors I wasn’t getting correctly.
Thanks!
You can use the gl_InstanceID built-in GLSL uniform value to access instance-specific values, for example data in a texture buffer.