opengl-es

Works on emulator, not on phone

This code: public void onSurfaceChanged(GL10 gl, int w, int h) { gl.glViewport(0, 0, w, h);// gl.glMatrixMode(GL10.GL_PROJECTION); gl.glLoadIdentity(); gl.glMatrixMode(GL10.GL_MODELVIEW); gl.glLoadIdentity(); // set camera zoom GLU.gluPerspective(gl, 45.0f,(float) w / h, 0.1f, 100.0f); // point camera GLU.gluLookAt(gl, 0, 1, 5, 0f...

How many normals?

if you are calculating the normals of a polygon for rendering it on WebGL, do you use a normal for every index in the index array or for every vertex on the vertex array? ...

Masking in OpenGL ES

Hello all, reading #20 tutorial on Nehe and a question here about masking, I implemented masking using b/w image and opaque image, however the result is completely not what is expected (I'm using OpenGL ES 1 on iPhone, so can't use shaders). Source+Mask=Result As can be seen on the result picture what is white on mask isn't transparent ...

Lookup table/palette shader on the iPhone

I have a fragment shader with the following: const lowp float colors[8] = float[8]( // line 12 0,0,0,1, 1,0,0,1 ); but it fails to compile: ERROR: 0:12: 'array of float' : array type not supported here in glsl < 120 ERROR: 0:12: 'array of float' : constructor not supported for type ERROR: 0:15: 'array of float' : no matchin...

OpenGL ES: Disabling transformation?

This NVIDIA video podcast (dated?) suggests bypassing OpenGL's matrix stack as a performance tip. It also suggets to bypass OpenGL's lighting, which implies that their intention is to actually transform the geometry manually. I happen to do this anyway for other reasons. Ofcourse, it doesn't make sense that you'll actually benefit from ...

Optimizing OpenGL ES on the iPhone and interpreting Instruments

I'm trying to push my FPS up on iPhone 3Gs from 30 as high as possible... and I'm running into a couple of issues and thought it would be better to ask for advice. 1) What exactly do the Renderer Utilization and Tiler Utilization columns on the OpenGL ES Instrument signify? My Tiler Utiliation percentage is extremely low, and my Rendere...

OpenGL: Overlay one texture over another and suppress white background

I am a starter of Iphone opengl ES programming. I have two textures, the first one is the background and occupies the full screen. I am printing the second picture on top of the first image but the white background of the second image covers part of the background. I want the background to be visible where the foreground picture has no c...

OpenGL unwanted color fading problem on triangle strip. Want to get uniform color over the triangle

Hello everyone, Here's my problem. I'm drawing a box using a GL_TRIANGLE_STRIP. There is no texture involved, no material and no shaders. I'm just rendering colored triangle. You can see what it looks like here : Fail box But as you can see, I've some clear color fading problem. There is no lighting activated either. Here the code I...

Mapping Multiple Textures to a Cube's faces in Android

Hi, I have just began opengl programming in android and i am fairly new to opengl as well. I've been using nehe's opengl tutorials as well as insanitydesign's android ports. I successfully managed to create a cube with a single texture mapped to all its 6 faces. I even mapped multiple textures to different faces of the cube. ...

How to begin creating 3D (Game-) GUIs for Android Applications (e.g. with OpenGL)?

I am new to Android Development. What I want is to know how I have to begin thinking to program a neat, sexy GUI. I guess the android.opengl API is a good starting point. Let's say we wanna create something like a simplified 3D-Pool-Billard-Game: You see the table from the top and you have on the table the balls. You want to make them r...

Circle and Sphere in OpenGL ES

In OpenGL ES 1.1 (using Objective-C), what is the easiest way to create a circle, and for a sphere? I would prefer for it to be easy to implement, as I am new to OpenGL. Thanks jrtc27 ...

Could somebody explain how to use glDrawElements (iPhone)?

Sorry for the duplicaiton, but I've been googlin' for hours now without any result. I have this (optimized) data of a simple cube exported from a converter: // 8 Verticies // 4 Texture Coordinates // 6 Normals // 12 Triangles static GLshort cubeFace_indicies[12][9] = { // Box001 {2,0,3 ,0,0,0 ,0,1,2 }, {1,3,0 ,0,0,0 ,3,2,1 }, ...

How can I draw a series of lines using OpenGL ES on iPhone OS?

I have tried as follows (got through Google search)- static const GLfloat vertices[] = { 0.0, 0.0, 250.0, 280.0, 250.0, 280.0, 250.0, 500.0, 250.0, 500.0, 350.0, 500.0, 350.0, 500.0, 250.0, 280.0 }; static const GLubyte squareColors[] = { 255, 255, 255, 255, 255, 255, 255, 255 }; glD...

What is EGL And How Can I Use It

Hi all , Can Anybody explain me what is EGL And How it does ?! How can i use EGL with OpenGL-ES On Linux?! IS EGL a Layer Between Hardware And Operating System ?! ...

iPad app only shows black screen after updating to iOS4 SDK.

I just opened an iPad app I'd been working on and it was working fine, until now. I open it and the screen remains black, even after it's loaded! It's an OpenGL and I just downloaded the iOS4 SDK. I also added a provisioning profile. Would any of these changes result in a completely black screen with no error for no reason at all? It lo...

Getting the OpenGL-ES Stencil Buffer Working

With the stencil buffer in opengl-es for Android, I'm simply trying to mask out drawing part of the screen. I think I have it set up right, but it is not masking out the non-stenciled parts. Below is an extraction of code for what I'm doing. gl.glEnable(GL10.GL_STENCIL_TEST); gl.glClearStencil(0); gl.glClear(GL10.GL_STENCIL_BUFFER_BIT);...

Minimising glDrawArray calls in OpenGl es

I'd like to hear what people think the optimal draw calls are for Open GL ES (on the iphone). Specifically I've read in many places that it is best to minimise the number of calls to glDrawArrays/glDrawElements - I think Apple say 10 should be the max in their recent WWDC presentation. As I understand it to do this you need to put all ...

OpengGL ES vertex buffer

Hello, I have the fallowing situation using vertex buffers in OpenGL on iPad: - render some objects with 30 FPS - delete the objects and create new ones(kill all entities and spawn others) - render the new objects The FPS drops to 10 for few seconds and slowly recovers to 30. I used some timers and I saw that render time increases from...

OpenGL doesn't render on Droid / Milestone

So, I'm writing a game engine. I have a little example (see http://qrcode.kaywa.com/img.php?s=8&amp;d=http://rokonandroid.com/rd.apk), that seems to work fine on every device except Droid / Milestone. It displays a blue screen (due to glClearColor being set to blue), and nothing more. I have tried with/without textures, and with/witho...

EAGLContext not work on openGLES 1 iphone os

Hello, i have a 3D project based on the EAGLView exemple from Apple. I have a very stange bug with the context ( i think ), my context is create by using : [context renderbufferStorage:GL_RENDERBUFFER_OES fromDrawable:(CAEAGLLayer*)self.layer]; on init the 3D view it's work, and on layout subview, my frameBuffer is destroy an crea...