


The OpenGL ES framework ( amework) in iOS provides implementations of versions 1.1, 2.0, and 3.0 of the OpenGL ES specification.

The error goes away when I specifically declare that I need ES 3.0 (GLSL 300 ES): #version 300 esĪlthough that seem to work fine on my Windows desktop machine in an ES 2.0 context I doubt that this would work on an iPhone 5. Overview OpenGL ES provides a C-based interface for hardware-accelerated 2D and 3D graphics rendering. #extension GL_EXT_draw_instanced : enable

'gl_InstanceID' : variable is not available in current GLSL versionĮnabling the "draw_instanced" extension in GLSL has no effect: #extension GL_ARB_draw_instanced : enable However, in my current setup I'm having trouble using the gl_InstanceID built-in variable in a vertex shader. I'm currently just running some test code using SDL and GLEW on Windows so I haven't tested anything on iOS yet. This makes me think that I could indeed use instanced drawing on older iOS devices too, by looking up and using the appropriate extension function (EXT or ARB) for glDrawArraysInstanced. However, further down in the compatibility reference document it says that the EXT_draw_instanced extension is supported for all SGX Series 5 processors (that includes iPhone 5 and 4s). So my first assumption was that I needed to avoid using instanced drawing on older iOS devices. According to the iOS Device Compatibility Reference ES 3.0 is only available on a few devices (those based on the A7 GPU so iPhone 5s, but not on iPhone 5 or earlier). The specification clearly says that these features require ES 3.0. I want to draw multiple instances of an object using glDrawArraysInstanced and gl_InstanceID, and I want my application to run on multiple platforms, including iOS. I am trying to learn OpenGL ES 2.Can anyone confirm whether it is possible to use the built-in variable gl_InstanceID (or gl_InstanceIDEXT) in a vertex shader using OpenGL ES 2.0 on iOS with GL_EXT_draw_instanced enabled?
