opengl-es-2.0
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
Choose OpenGL ES 1.1 or OpenGL ES 2.0?
Whether to use OpenGL ES 1.1 or 2.0 depends on what you want to do in your application, and how many devices you need it to be compatible with. All iOS devices support OpenGL ES 1.1, where only the iPhone 3G S and newer devices (iPhone 3G S, iPhone 4, iPad, and 3rd and 4th … 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
Why not vec3 for OpenGL ES 2.0 gl_Position?
The w in vec4(x, y, z, w) is used for clipping, and plays its part while linear algebra transformations are applied to the position. By default, this should be set to 1.0. See here for some more info: http://web.archive.org/web/20160408103910/http://iphonedevelopment.blogspot.com/2010/11/opengl-es-20-for-iOS-chapter-4.html
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
Android freeze in OpenGL|ES (CPU may be pegged. trying again.)
I also came across this issue, I used to re-install the Application and it worked for me.If not, then simply reboot your device.This issue is related to internal isssue of OpenGLES.You can refer this link: Android “cpu may be pegged” bug
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
How to get a “Glow” shader effect in OpenGL ES 2.0?
First of all there are tons of algorithms and techniques to generate a glow effect. I just want to present one possibility. Create a Material that is luminescent. For this I use a modified Blinn-Phong light model, where the direction to the light source is always the inverse direction of the normal vector of the … Read more