Documentation
¶
Overview ¶
Instanced drawing example using OpenGL ES 3.0.
Demonstrates DrawArraysInstanced -- the ES3 call that renders multiple copies of geometry in a single draw call. Each instance receives a unique gl_InstanceID in the vertex shader, which is used here to position copies of a small triangle in a grid pattern.
The vertex shader uses gl_InstanceID (built-in in GLSL ES 3.00) to compute a per-instance offset. No VertexAttribDivisor is needed for this approach because the offset is derived from the built-in instance index rather than from a per-instance attribute buffer.
This program must run on an Android device with OpenGL ES 3.0 support.
Click to show internal directories.
Click to hide internal directories.