Tagged Questions

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

learn more… | top users | synonyms

8
votes
1answer
6k views

What do the components of gl_TexCoord[0] mean?

What are the differences between gl_TexCoord[0].s, gl_TexCoord[0].t gl_TexCoord[0].p and gl_TexCoord[0].x, gl_TexCoord[0].y gl_TexCoord[0].z ? I understand that gl_TexCoord[0].x, gl_TexCoord[0].y ...
2
votes
1answer
797 views

How to convert from OpenGL to OpenGL ES?

I need to convert code from OpenGL to OpenGL ES 1.1, I found that the GLUT library is missing in that. Can anyone tell me what do I do to replace glRasterPos3f in OpenGL?
4
votes
2answers
3k views

Changing the color of some fragment of a texture using shaders

Declarative programming language QML allows to connect the elements, their properties with universal variables in shader programs description. For these purposes there is such elements as ...
3
votes
2answers
1k views

What is causing these visual artifacts on my OpenGL sprites?

What could be the cause of the defects in my characters sprite? I am using OpenGL ES 2.0. I draw my sprites in a sprite batch that uses UV coordinates from one large texture atlas. If you look around ...
-3
votes
1answer
1k views

What can be the cause of sudden lag spikes in my Android game?

My Android game has sudden lag spikes sometimes. I know this is due to something going wrong. My phone has a 1GHz processor so there shouldn't be a problem. Basically I use the Canvas class to render ...
3
votes
2answers
494 views

What is UVIndex and how do I use it on OpenGL?

I am a noob in OpenGL ES 2.0 (for WebGL) and I'm trying to draw a simple model I've made with a 3D tool and exported to .fbx format. I've been able to draw some models that only have: A vertex buffer, ...
1
vote
3answers
2k views

How do I repeat a texture with GLKit?

I am using GLKit in order to show textures on my project. The code is like this: -(void)setTextureImage:(UIImage *)image { NSError *error; texture = [GLKTextureLoader ...
1
vote
2answers
734 views

What is the best way to store meshes or 3d models in a class

I am wondering, how I should store my mesh into memory after loading it from whatever file. I have Questions floating in my head: Should a mesh could have sub meshes or does the 3d model just store ...
4
votes
1answer
374 views

UVW: better explanation, and how to implement with GLES texture2D()

UVW texture coordinates, as opposed to UV texture coordinates, do not get very adequate explanation on the web. Many people offer the simple exlanation, "UV is for 2-dimensional textures and UVW are ...
1
vote
2answers
352 views

What do I need to know for writing code for both OpenGL and OpenGL ES 2.0

I am developing an engine that uses both OpenGL and OpenGL ES 2.0. I am well seasoned in OpenGL but not ES (although I am aware it is a subset of OpenGL). I could not find a set of differences that I ...
3
votes
2answers
2k views

How to make a background fill the screen on different-resolution phones?

I am developing my first Android OpenGL game. It's a 2D game and I would like the background to always fill the screen. I've managed to achieve this by stretching the texture to fit the size of the ...
0
votes
1answer
1k views

Equivalent of glDrawTexfOES in OpenGL ES 2.0?

I have been using the glDrawTexf extension to draw labels in my Android app using OpenGL ES 1.1. But I have now moved to OpenGL ES 2.0 and can't figure out what is the equivalent of this call? I ...
9
votes
3answers
2k views

Is it worth supporting iOS 3.x or iPhone 3G devices anymore when developing a game?

Is it still worth it for a game developer to try and support older devices: iPhone 3G and earlier or to support older OS: iOS 3.x and earlier? Or is it recommended to make use of OpenGL ES 2.0 ...
3
votes
1answer
542 views

Unusual Lighting Effects - Random Polygons Coloured

I am working on creating an object loader for use with iOS, I have managed to load the vertices, normals and face data from and OBJ file, and then place this data into arrays for reconstructing the ...
1
vote
1answer
500 views

OpenGL ES Faces appear to be transparent when alpha is 1.0?

I am working on an object (OBJ File) loader for my app on iOS, currently I have successfully read the vertices and the faces of the object, and I am now just adding colours to the imported models. I ...
2
votes
3answers
759 views

Culling Techniques for 3d OpenGL ES game

I'm developing a 3d flight simulator for Android and am using a relatively large (10k triangles) scene in 3ds format for the scenery. The scene is one polygon soup, not separated into separate ...
4
votes
2answers
2k views

How should I represent a tile in OpenGL-es

Let me start with I am currently learning OpenGl-es using Android. I have been having the hardest time trying to design a simple and logical way of making tiles (2d flat polygons). The tutorials tell ...
4
votes
2answers
2k views

What should I do to get my Blender models into my iOS game?

I am working on a 3D OpenGL|ES game for iPad. All the models are created in Blender. How should I go about getting my models into my game? I have the following requirements of my models: One ...
2
votes
5answers
2k views

Skipping glReadPixels and reading iPhone's “VRAM” directly

I'd like to rapidly capture "screenshots" of my OpenGL ES iPhone game and turn them into a video. I've tried the following approach (it works but degrades the game play to an unacceptable level): ...
0
votes
3answers
931 views

does opengl automatically handle offscreen rendering?

I'm wondering if opengl can automatically manage offscreen rendering. I mean if it can detect and ignore sprites and textures if they are rendered out of screen. if it makes any difference i'm ...
1
vote
1answer
1k views

What is OpenGL ES Shading Language based on and what are the differences?

My guess is that it is derived from version 1.10 of the OpenGL Shading Language, document revision number 59. Found it here, page 7: ...
0
votes
2answers
2k views

Most efficient way to capture OpenGL ES content of iPhone screen

I'd like to efficiently capture a "screenshot" of my OpenGL ES iPhone game. I put screenshot in quotes because I really want to move the screen contents into a pixel buffer that I can eventually use ...
9
votes
1answer
9k views

Blend Modes in Cocos2D with glBlendFunc

We've been trying to replicate the most common blending modes that are available in Photoshop and Quartz 2D, but we've only come up with 3 and that's after some long searching online. For anyone ...
1
vote
0answers
693 views

Rotation deforming mesh (Opengl ES 2.0)

I'm trying to render a rotating cube on Opengl ES 2.0, using some math classes I wrote (based on a lot of online and offline info) for quaternions, matrixes and the like. As far as I know all the math ...
8
votes
2answers
802 views

Recording the gameplay in the game itself?

I'm presently working on a 3D car racing game for the iOS platform. I had to implement a replay system and then record that replay in a video file to upload it to YouTube. I'm only having issues ...
0
votes
3answers
302 views

I started my journey this way, am I on the right track? [closed]

I started my journey to learn games programming from the scratch (I'm a software developer but not in gaming field), I'm targeting iOS games development. Currently I'm ready "O'reilly iPhone Game ...
1
vote
1answer
219 views

Can OpenGL ES help in this game?

I am learning OpenGL ES and I have setup the environment. I believe the best way to learn things is to grab a dummy project and start working on it. So what I plan to do is... Now I want this ...
4
votes
1answer
494 views

Phone complains that identical GLSL struct definition differs in vert/frag programs

When I provide the following struct definition in linked frag and vert shaders, my phone (Samsung Vibrant / Android 2.2) complains that the definition differs. struct Light { mediump vec3 ...
2
votes
2answers
1k views

Best method for 2 layer tile based map scrolling

What is the best general approach to implement scrolling for a 2D tile based game? I need to scroll the map with a constant speed, lets say 2 pixels every frame (like in a top down shooter). The ...
0
votes
2answers
660 views

Graphical Android game: Bad performance in some situations

I am developing a simple graphical game for Android (Java and OpenGL ES). There is no high-end graphics involved, basically a few (less than 10) sprites and some (about 10) dynamically drawn ...
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
3answers
2k views

How can I convert an image from raw data in Android without any munging?

I have raw image data (may be .png, .jpg, ...) and I want it converted in Android without changing its pixel depth (bpp). In particular, when I load a grayscale (8 bpp) image that I want to use as ...
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 ...
4
votes
4answers
6k views

GLM: Euler Angles to Quaternion

I hope you know GL Mathematics (GLM) because I've got a problem, I can not break: I have a set of Eular Angles and I need to perform smooth interpolation between them. The best way is converting them ...
0
votes
2answers
454 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, ...
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 ...
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 ...
30
votes
4answers
16k views

Workaround to losing the OpenGL context when Android pauses?

The Android documentation says: There are situations where the EGL rendering context will be lost. This typically happens when device wakes up after going to sleep. When the EGL context is ...
2
votes
1answer
545 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
916 views

Android : Some textures not loading after resuming twice

This is an odd one. When I press home and then restart my game I reload all my textures (checking glIsTexture on the id's first). If I do this once, all textures load as expected, but if I do it ...
2
votes
2answers
985 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
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 ...
11
votes
6answers
12k views

OpenGL ES 2.0: Repository of Quality Shaders

Could I kindly ask, to suggest me a repository of high quality OpenGL (OpenGL ES 2.0) vertex and fragment shaders, please? I am looking for pixel based ligting shaders (such as phong) and simmilar. ...
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 ...
4
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. ...