opengl-es

Pause animation in EAGLView which is in a UITableViewCell

I have an animation in a EAGLView which is itself in a UITableViewCell. How can I pause the animation in the EAGLView when the view is not visible? Normally, I would simply use the responsible UIViewController and listen to viewDidDisappear. But how do I do that if the EAGLView is in a table? ...

Android: 2D. OpenGl or android.graphics?

I'm working with my friend on our first Android game. Basic idea is that every frame of the game the whole surface is redrawn (1 large bitmap) in 2 steps: Background with some static image (PNG) wipes out previous frame Then it is sprinkled all over with large number of particles which produces effect of soapy bubbles where there's a p...

How to center viewport at center of the sphere

I want to create panorama view with opengl in Android. Is it possible using spherical view and centering viewpoint at the sphere center to show bounded image on screen? Will this be a good aproach? I haven't used opengl but want to achive this effect in Android. Am I going in right direction? Any pointers for this will be great help. Th...

opengl es color picking on android without screen flashing

i have written a object selection algorithm which picks the objects by their color. i give every object an unique color and then i just have to use the glReadPixels method to check which object was selected this works fine and is really fast but the problem is that the frame is displayed on the screen with all the picking-colors so the ...

Render to texture or offscreen framebuffer

I have a problem with rendering to texture and offscreen framebuffer with OpenGL ES on iPhone. First image shows mahjong tiles rendered to CAEAGLLayer directly and this is correct. Second one shows tiles rendered to offscreen framebuffer, copied to texture using glCopyTexImage2D and the texture rendered to CAEAGLLayer. Both use white ...

Difference between GL10 and GLES10 on Android

The GLSurfaceView.Renderer interface of the Android SDK gives me a GL interface as parameter which has the type GL10. This interface is implemented by some private internal jni wrapper class. But there is also the class GLES10 where all the GL methods are available as static methods. Is there an important difference between them? So what...

iphone: how to do Page turning

hi frnds, I am facing the problem from a month and didn't find anything from google.. I am using UIView for pdf display. there is no problem with pdf but problem is with transition. I have to turn each page of pdf with realistic page turn exp. I search, dig a lot about that but i didn't get anything that how to do that. I don't want t...

iPhone and Vertex Buffer Objects

I've just started playing around with opengl es on the iphone the past couple of weeks and i'm looking at refactoring some of my code to use Vertex Buffer Objects(VBO). Before I do though I would like to make sure it'll be worth it. The problem is that afaik the only reason you create VBO's is to shift a chunk of data onto the graphics c...

Android GLSurfaceView glTexImage2D glDrawTexiOES

I'm trying to render a 640x480 RGB565 image using OpenGL ES on Android using GLSurfaceView and Native C code. Initially I had a 0x0501 error with glTexImage2D, which I was able to resolve by changing the image dimensions. But now, in the "drawFrame" call, when I do glDrawTexiOES to resnder the texture, I'm getting the following error o...

another question about OpenGL ES rendering to texture

Hello, pros and gurus! Here is another question about rendering to texture. The whole stuff is all about saving texture between passing image into different filters. Maybe all iPhone developers knows about Apple's sample code with OpenGL processing where they used GL filters(functions), but pass into them the same source image. I need ...

glDrawArrays() slow on iPad?

Hey guys, I was wondering how to speed up my iPad application using OpenGLES 2.0. At the moment we have every drawable object draw itself with a call to glDrawArrays(). Blend mode is on, we really need it. Without disabling blendmode, how would we improve performance for this app? For instances, if we now draw 3 textures (1024x1024, 25...

OpenGL ES and real world development

Hi Guys, I'm trying to learn OpenGL ES quickly (I know, I know, but these are the pressures that have been thrusted upon me) and I have been read around a fair bit, which lots of success at rendering basic models, some basic lighting and 'some' texturing success too. But this is CONSTANTLY the point at which all OpenGL ES tutorials end...

OpenGL ES 2.0 Rendering with a Texture

The iPhone SDK has an example of using ES 2.0 with a set of (Vertex & Fragment) GLSL shaders to render a varying colored box. Is there an example out there on how to render a simple texture using this API? I basically want to take a quad, and draw a texture onto it. The old ES 1.1 API's don't work at all anymore, so I'm needing a bit ...

How color attributes work in VBO?

I am coding to OpenGL ES 2.0 (Webgl). I am using VBOs to draw primitives. I have vertex array, color array and array of indices. I have looked at sample codes, books and tutorial, but one thing I don't get - if color is defined per vertex how does it affect the polygonal surfaces adjacent to those vertices? (I am a newbie to OpenGL(ES)) ...

Why OpenGL ES texture mapping is very slow?

I have an Android application that displays VGA (640x480) frames using OpenGL ES. The application reads each frame from a movie file and updates the texture accordingly. My problem is that, it is taking almost 30 ms. to draw each frame using OpenGL. Similar test using the Canvas/drawBitmap was around 6 ms on the same device. I'm fol...

OpenGL-ES: Change (multiply) color when using color arrays?

Following the ideas in OpenGL ES iPhone - drawing anti aliased lines, I am trying to draw stroked anti-aliased lines and I am successful so far. After line is draw by the finger, I wish to fade the path, that is I need to change the opacity (color) of the entire path. I have computed a large array of vertex positions, vertex colors, te...

iPhone OpenGL ES - occasional initialisation problem

I am using OpenGL for a 2D graphing application. I have recently started having strange problems with the UIView that displays the GL render buffer. Sometimes (40% of the time?) when it initialises, the view is in a frozen state, occasionally displaying artefacts of the last successful running of the program. The rest of the program is...

optimizing iPhone OpenGL ES fill rate

I have an Open GL ES game on the iPhone. My framerate is pretty sucky, ~20fps. Using the Xcode OpenGL ES performance tool on an iPhone 3G, it shows: Renderer Utilization: 95% to 99% Tiler Utilization: ~27% I am drawing a lot of pretty large images with a lot of blending. If I reduce the number of images drawn, framerates go from ~20 ...

iPhone NSTimer OpenGL problem

I've got a problem that only seems to occur on the device, not in the simulator. My app's animation is started and stopped using these methods: NSTimer* animationTimer; -(void)startAnimation { if(animationTimer == nil) animationTimer = [NSTimer scheduledTimerWithTimeInterval:1.0f/60.0f target:self selector:@selector(drawVi...

opengl paint program based on Apple's 'glPaint' on a white background - how to blend?

Trying to write a simple paint program for iPhone, and I'm using Apple's glPaint sample as a guide. The only problem is, painting doesn't work on a white background, since white + colour = white. I've tried different blending functions, but haven't been able to hit on the right combination of settings and/or brushes to make this work. ...