Subset of the OpenGL 3D graphics API designed for embedded devices such as mobile phones.

learn more… | top users | synonyms

4
votes
1answer
2k views

OpenGL or Canvas?

I'm writing a 2D snake-like game for android (Hungry Birds, already in the market), and now I'm wondering if I should port it to OpenGL so that the performance can stay stable while I continuously add ...
7
votes
2answers
2k views

Why must the transpose value of glUniformMatrix4fv in webgl/OpenGL ES be false?

Why must the transpose value of glUniformMatrix4fv in webgl/OpenGL ES be false? The OpenGL ES spec says that the transpose value must be false or an INVALID_VALUE is generated. Why then have the ...
1
vote
1answer
502 views

Questions before I revamp my rendering engine to use shaders (GLSL)

I've written a fairly robust rendering engine using OpenGL ES 1.1 (fixed-function.) I've been looking into revamping the engine to use OpenGL ES 2.0, which necessitates that I use shaders. I've been ...
2
votes
1answer
4k views

Faster way to draw dynamic meshes in OpenGL ES

I'm writing a 3D game which is going to inlcude some dynamic meshes. For now, my code looks like this : private float[] mVertices; private FloatBuffer mVertexBuffer; public void onDrawFrame(GL10 ...
0
votes
2answers
2k views

OpenGL ES Framebuffer creation problem

I'm having some problems porting my D3D code to OpenGL ES. I have a Graphics Device class that encapsulates all rendering commands. The code below is in an ObjC++ file. The problem code is the called ...
0
votes
2answers
450 views

Linear Interpolation Causing Gimbal Lock?

I have created an object movement path in a 3D authoring application. Then, I exported the path (100 frames) into my custom text file in the form of Euler Angles. The next point was loading the ...
2
votes
1answer
2k views

OpenGLES 2.0: Rendering Multiple Sprites - Texel Corruption

I'm having a tremendous time getting the second (or additional) sprites in my game engine to render properly. The first one always works great: it is positioned and sized properly in screen coords, ...
1
vote
2answers
5k views

OpenGL ES 2.0: Controlling Transparency in Fragment Shader

The following is the OpenGL ES 2.0 simple GLSL Fragment Shader, I use to place textures on polygons, to render 2D sprites. varying mediump vec2 TextureCoordOut; uniform sampler2D Sampler; void ...
1
vote
2answers
2k views

OpenGL ES 2.0: Perspective Projection for 2D Games

Prespective Projection has features that could be very well used even in 2D games. At least two very beneficial characteristics that come to my mind are: Using Perspective Projection to substitute ...
5
votes
1answer
6k views

OpenGL ES 2.0: Understanding Perspective Projection Matrix

Setting the Perspective projection matrix in Open GL (including OpenGL ES 2.0) has the following general format: glm::mat4 perspective(float fovy, float aspect, float zNear, float zFar); Notice the ...
2
votes
1answer
540 views

OpenGL ES GL_FIXED versus GL_FLOAT

I am writing an app for Android, using OpenGL ES 1.x I am confused as to whether I should use GL_FLOAT or GL_FIXED, the priority being performance regarding GPU operations(does GL_FIXED need to be ...
1
vote
1answer
892 views

Data Organization in Custom 3D Mesh File Format

After careful consideration to use middleware, I have decided on creating my own 3d file format format to export meshes from 3D authoring application (Softimage) into my game. I will need to export ...
2
votes
2answers
970 views

Is there any scroll algorithm for OpenGL ES?

I was working on J2ME games in the past, when draw a large backgroud, I always use the Carmack 2d scroll algorithm, keep a image buffer a little larger than device screen, draw the changed small tiles ...
0
votes
3answers
855 views

OpenGL ES 1.1 strange slow drawing by zooming on iPhone

I have created a view (derived from UIScrollView) where the cells are drawn and zoom occurs. Everything is drawn with OpenGL ES 1.1. Zoom is specified by adding of a calculated new distance which is ...
0
votes
2answers
2k views

OpenGL ES 2.0: Calculated Cube Vertex Normals Verification

Could I kindly ask to confirm, that the calculated normals are correct, please? I have calculated them on my own, but my testcube is still strangely lighted within OpenGLES 2.0. The vertices were ...
1
vote
1answer
1k views

OpenGL ES 2.0: Converting GL_TRIANGLES into GL_TRIANGLE_STRIP

I export my 3D geometry from a 3D authoring application. It is possible to export the vertex coordinates as full triangle arrays. On ther other hand, triangle strips are more efficient for the ...
2
votes
1answer
3k views

OpenGL ES 2.0: Moving Camera in Orthogonal (2D) Projection

I have quite large 2D game scene. The scene is much larger than the screen of the LCD. Therefore, I have to move the camera (view) in desired directions, to display particular parts of the scene. ...
2
votes
2answers
989 views

OpenGL ES 2.0: Picking Individual Polygon Sprites from within VBO

Say, I send 10 polygon pairs (one polygon pair == one 2d sprite == one rectangle == two triangles) into OpenGL ES 2.0 VBO. The 10 polygon pairs represent one animated 2D object consisting of 10 ...
1
vote
0answers
192 views

How to ensure that a 3D coordinate at Z=1 act like a 2D coordinate (using perspective projection) [duplicate]

Possible Duplicate: OpenGL ES 2.0: Mixing 2D with 3D The title probably is not that clear but please help me out here. I am going to write a (mostly) 2D game using OpenGL ES 2.0 so if I ...
4
votes
1answer
789 views

Middleware to Bring 3D Meshes into OpenGL ES 2.0

Say I develop a game for mobile platform running OpenGL ES 2.0. I have done 2D part, and now I wish to import some 3D objects. The imported 3D objects must contain the following: Vertices positions ...
2
votes
2answers
992 views

OpenGL ES on iOS Books

I was wondering if someone has read both the: iPhone 3D Programming And OpenGL ES 2.0 books and have an opinion if one is better than the other? I'm basically wanting to get into doing 3D ...
6
votes
1answer
1k views

Adding a simple mix() destroys the framerate

I have a very simple shader and added linear fog via mix like this: finalColor = mix(finalColor, vec3(0.5, 0.8, 0.95), vUVoutAndViewZ.z); Note that the view Z distance is in the variable that also ...
5
votes
3answers
9k views

Android - Efficient way to draw tiles in OpenGL ES

I am trying to write efficient code to render a tile based map in android. I load for each tile the corresponding bitmap (just one time) and then create the according tiles. I have designed a class to ...
0
votes
1answer
916 views

OpenGL - resize texture when using cubemap

I want to resize my texture. I am using cubemap to compute reflection. I want to use this cubemap to draw skybox. Skybox is drawn but I want to resize texture down, because it is dilated. As I wrote ...
3
votes
2answers
744 views

Faster way to scale images than gluScaleImage?

I'm porting a C++ game to Android using the NDK and there's one bottleneck that's really slowing down the code: gluScaleImage(). Does anyone know of a faster way to scale image textures?
1
vote
2answers
413 views

opengl rotations for a human

I currently can rotate around a pivot point by first translating to the pivot point then performing the rotation and finally translating back to the origin. I do that easily enough for the shoulder in ...
4
votes
2answers
766 views

Optimising the modelview transformation in GLSL for 2D

So, the standard way to transform vertices and then pass to the fragment shader in GLSL is something like this: uniform mat4 u_modelview; attribute vec4 a_position; void main() { gl_Position = ...
4
votes
1answer
3k views

How to create a perspective field of view matrix?

Hey, hello. I am learning a little of WebGL (OpenGL ES 2.0) through the http://learningwebgl.com tutorials, but it uses a third party library to create the View, Projection and transformation matrices ...
4
votes
2answers
568 views

How effects found in “Autodesk Fluid FX” are implemented using OpenGL ES?

How this kind of effects are technically implemented using OpenGL ES? Are they performing simulation on GPU (using Shaders) or CPU while using some smart vertex positioning and texturing? Why it ...
1
vote
2answers
942 views

Disabling depth write trashes the frame buffer on some GPUs

I sometimes disable depth buffer writing via glDepthMask(GL_FALSE) during the alpha rendering of a frame. That works perfectly fine on some GPUs (like the Motorola Droid's PowerVR), but on the HTC EVO ...
4
votes
1answer
1k views

How do I render only part of a texture to a point sprite in OpenGL ES for Android?

Using the libgdx framework, I've figured out how to render a texture to a point sprite. The problem is, it renders the entire texture to the point sprite, where I only want a small part of it (since ...
2
votes
2answers
1k views

Can one draw a cube using different method/drawing mode?

I've just started learning gamedev (in particular android EGL based) and have ran over a code from Pro Android Games 2 that looks as follows: /* * Copyright (C) 2007 Google Inc. * * Licensed ...
9
votes
2answers
6k views

How do I use depth testing and texture transparency together in my 2.5D world?

Note: I've already found an answer (which I will post after this question) - I was just wondering if I was doing it right, or if there is a better way. I'm making a "2.5D" isometric game using OpenGL ...
5
votes
1answer
2k views

Game Code Design for Rendering

I first created a game on the iPhone and I'm now porting it to Android. I wrote most of the code in C++, but when it came to porting it wasn't so easy. The Android's way is to have two threads, one ...
2
votes
1answer
4k views

Computing a normal matrix in conjunction with gluLookAt

I have a hand-rolled camera class that converts yaw, pitch, and roll angles into a forward, side, and up vector suitable for calling gluLookAt. Using this camera class I can modify the model-view ...
4
votes
5answers
3k views

How can I improve the “smoothness” of a 2D side-scrolling iPhone game?

I'm working on a relatively simple 2D side-scrolling iPhone game. The controls are tilt-based. I use OpenGL ES 1.1 for the graphics. The game state is updated at a rate of 30 Hz... And the drawing ...
8
votes
1answer
20k views

GLSL: How Do I cast a float into an int?

In a GLSL fragment shader I am trying to cast a float into an int. The compiler has other ideas. It complains thusly: ERROR: 0:60: '=' : cannot convert from 'mediump float' to 'highp int' I am ...
2
votes
2answers
3k views

OpenGL-ES: clearing the alpha of the FrameBufferObject

This question is a follow-up to Texture artifacts on iPad How does one "clear the alpha of the render texture frameBufferObject"? I've searched around here, StackOverflow and various search engines ...
3
votes
2answers
550 views

Texture artifacts on iPad

I'm porting an iPhone game to the iPad. When I move textures "quickly" (5.0 pixels every update at a rate of 60 Hz) I start to see little "artifacts" or remnants of where the texture used to be. I'm ...
6
votes
2answers
3k views

OpenGL ES 2.0: Using VBOs?

OpenGL VBOs (vertex buffer objects) have been developed to improve performance of OpenGL (OpenGL ES 2.0 in my case). The logic is that with the help of VBOs, the data does not need to be copied from ...
2
votes
1answer
287 views

Creating an alphabet with numbers in 3d using opengl-es

How should I create an alphabet with numbers in 3d in opengl-es? I'm trying to create them with the existing primitives, but it's not looking good. Do we have any alternate way to get these things ...
3
votes
2answers
1k views

How to create per-vertex normals when reusing vertex data?

I am displaying a cube using a vertex buffer object (gl.ELEMENT_ARRAY_BUFFER). This allows me to specify vertex indicies, rather than having duplicate vertexes. In the case of displaying a simple ...
1
vote
1answer
616 views

OpenGL ES Loading

I want to know what is the norm of loading rendering code. Take a button. When the application is loaded, a texture is loaded which has the image of the button on it. When the button is tapped, it ...
7
votes
2answers
1k views

Missing features from WebGL and OpenGL ES

I've started using WebGL and am pleased with how easy it is to leverage my OpenGL (and by extension OpenGL ES) experience. However, my understanding is as follows: OpenGL ES is a subset of OpenGL ...
2
votes
1answer
3k views

Using gluLookAt to move camera in 2D iPhone game?

I'm trying to use gluLookAt to move the camera in my iPhone game, but every time I've tried to use gluLookAt my screen just goes "blank" ( grey in this case ) I'm trying to render a simple triangle ...
5
votes
2answers
3k views

In OpenGL Can I Discover the Depth Range of a Depth Buffer?

I am doing a GL multi-pass rendering app for iOS. The first pass renders to a depthbuffer texture. The second pass uses the values in the depth buffer to control the application of a fragment shader. ...
6
votes
2answers
623 views

OpenGL or OpenGL ES

What should I learn? OpenGL 4.1 or OpenGL ES 2.0? I will be developing desktop applications using Qt but I may start developing mobile applications in a few months, too. I don't know anything about ...
-3
votes
2answers
6k views

Make Pong on android using OpenGL-ES

I am trying to make a simple pong game using opengl-es. I have checked out some of the tutorials/samples, but most of them are pre-dated to 2009. I am familiar with game programming, and consider ...
4
votes
2answers
478 views

What is the ballpark GL framerate for iPad and iPhone 4?

Does anyone the GL frame rate for iPad and iPhone 4 under the follow conditions: Unlit Non supersampled GLSL texture mapped with two textures. Single quad, 4 vertices Thanks, Doug
3
votes
1answer
2k views

Why does glGetUniformLocation report some of my uniform locations as -1?

I have been writing GLSL shaders for over a year but this is the first time I have run into this problem. I am on the iOS platform - if that matters. In a vertex shader I have this: uniform mediump ...