instanced-drawing

command
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 22, 2026 License: MIT Imports: 5 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL