GLKView set drawable properties

If you want to get kEAGLDrawablePropertyRetainedBacking in a GLKView, add the following category to your project. @interface CAEAGLLayer (Retained) @end @implementation CAEAGLLayer (Retained) – (NSDictionary*) drawableProperties { return @{kEAGLDrawablePropertyRetainedBacking : @(YES)}; } @end Setting the drawableProperties on the CAEAGLLayer maintained by the GLKView doesn’t work because the GLKView overwrites those properties when it binds its … Read more

Render multiple objects with OpenGL ES 2.0

The best way I found to do this is using VAOs in addition to VBOs. I’ll first answer you question using VBOs only. First of all, assume you have the two meshes of your two objects stored in the following arrays: GLuint _vertexBufferCube1; GLuint _vertexBufferCube2; where: GLfloat gCubeVertexData1[36] = {…}; GLfloat gCubeVertexData2[36] = {…}; And … Read more

Differences between GLSL and GLSL ES 2

Is GLSL ES 2 a totally separate language, or a special version of GLSL? Every version of GLSL is ultimately a “totally separate language;” some aren’t even backwards compatible with previous versions. However, the ES variation of GLSL is even moreso. Think of it as a fork of desktop GLSL. A fork of GLSL from … Read more

What are the differences between OpenGL ES 2.0 and OpenGL ES 3.0

Overall the changes increase flexibility with bigger buffers, more formats, more uniforms, etc. Additional features such as instanced rendering, pixel buffer objects, and occlusion queries, provide opportunities for optimization. Depending on your platform it could be revolutionary, however many of the key features were already extensions on platforms such as iOS. For my work personally, … Read more

Modifying camera output using SurfaceTexture and OpenGL

mDirectVideo = new DirectVideo(texture); texture = createTexture(); should be texture = createTexture(); mDirectVideo = new DirectVideo(texture); Shader private final String vertexShaderCode = “attribute vec4 position;” + “attribute vec2 inputTextureCoordinate;” + “varying vec2 textureCoordinate;” + “void main()” + “{“+ “gl_Position = position;”+ “textureCoordinate = inputTextureCoordinate;” + “}”; private final String fragmentShaderCode = “#extension GL_OES_EGL_image_external : require\n”+ … Read more