opengl-es

Advice on speeding up OpenGL ES 1.1 on the iPhone

I'm working on an iPhone App that relies heavily on OpenGL. Right now it runs a bit slow on the iPhone 3G, but looks snappy on the new 32G iPod Touch. I assume this is hardware related. Anyway, I want to get the iPhone performance to resemble the iPod Touch performance. I believe I'm doing a lot of things sub-optimally in OpenGL and ...

Draw to offscreen renderbuffer in OpenGL ES (iPhone)

I'm trying to create an offscreen render buffer in OpenGL ES on the iPhone. I've created the buffer like this: glGenFramebuffersOES(1, &offscreenFramebuffer); glBindFramebufferOES(GL_FRAMEBUFFER_OES, offscreenFramebuffer); glGenRenderbuffersOES(1, &offscreenRenderbuffer); glBindRenderbufferOES(GL_RENDERBUFFER_OES, offscreenRen...

OpenGL ES - Get current blendFunc

I want to do something like this: currentBlendFunc = glGetCurrentBlendFunc(); glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // [...] do stuff glBlendFunc(currentBlendFunc.src, currentBlendFunc.dest); Is there a way to get the current blend func? ...

How to setup OpenGL camera for a racing game

I need the view to show the road polygon (a rectangle 3.f * 100.f) with a vanishing point for a road being at 3/4 height of the viewport and the nearest road edge as a viewport's bottom side. See Crazy Taxi game for an example of what I wish to do. I'm using iPhone SDK 3.1.2 default OpenGL ES project template. I setup the projection ma...

glDrawElements allocating memory and not releasing it

Using OpenGLES 1.1 on the iPhone 3G (device, not simulator), I do normal drawing fun. But at points during the run of the application I get giant memory spikes, after a lot of digging with instruments I have found that it is glDrawElements that is grabbing the memory. The buffer being allocated is 4 meg, which to me means its loading a ...

Does it make sense to use Vertex Buffer Objects even when changing the Model View matrix?

I'm looking to get some additional performance (FPS) increases on my iPhone App. I'm already using interleaved data, GL_SHORT and a single texture atlas. See this question for details of what I've already done. Now I want to look at using VBOs to increase performance. According to Apple's OpenGL ES documentation this is a good step t...

What is DOT3 lighting?

An answer to my question suggests that DOT3 lighting can help with OpenGL ES rendering, but I'm having trouble finding a decent definition of what DOT3 lighting is. Edit 1 iPhone related information is greatly appreciated. ...

Any idea why glVertexPointer() wouldn't draw anything when using GL_FLOAT?

Using GLfixed as my vertex number type the following code draws textures as expected: GLfixed vertices[] = { (int)point.x, (int)point.y + size.height, (int)point.x + size.width, (int)point.y + size.height, (int)point.x, (int)point.y, (int)point.x + size.width, (int)point.y }; glVertexPointer(2, GL_FIXED, 0, vertices); I read...

Adding a decal using multitexturing on an iPhone

I'm trying to overlay one image on top of another onto a simple quad. I set my bottom image as texture unit 0, and then my top image (which has a variable alpha) as texture unit 1. Unit 2 has mode GL_DECAL, which means the bottom texture should show up when the alpha is 0, and the top texture should show when the alpha is 1. But, only th...

Glitch when moving camera in OpenGL

I am writing a tile-based game engine for the iPhone and it works in general apart from the following glitch. Basically, the camera will always keep the player in the centre of the screen, and it moves to follow the player correctly and draws everything correctly when stationary. However whilst the player is moving, the tiles of the surf...

Best way for learning OpenGL ES

I'm fixing to start on my second app which will be a game and I'm wanting to start learning OpenGL ES. I haven't been able to find many books out there that teach opengl es so I'm trying to figure out the best way to learn. I'm wanting to get to the level of almost an expert because I would like to be a full time mobile game developer on...

NSThread and OpenGL Problem

My Game (made using OpenGLES 2D) is Completely Working and Now we are trying to add Loading screen in between Levels while deallocating all resources and allocate new resources the loading screen should appear So for this we ve decided to us NSThread //setting flag for thread [NSThread detachNewThreadSelector:@selector(LoadingScreen:...

Where to start learning open-gl es

Hi everybody, I decide to learn OPEN-GL ES for IPHONE development, but I know nothing about graphics programing. So I've some questions. 1 I know OPEN-GL ES is a series of open standard API. IPHONE still use these standard API or apple define it's own API for OPENGL ES? 2 Before I start to learn OPEN-GL ES, I think I should be familiar...

Possible to perform vertex blending (skinning) on OpenGl ES 1.1 ipod Touch?

I'm currently trying to make a simple model viewer for the iPod Touch, and I managed to render the model meshes where vertex blending is not performed (that is, mesh is attached to a single skeleton bone matrix). In cases were a mesh use weights to perform blending, is there a way to do it in the ipod Touch using OpenGL ES 1.1? thanks ...

OpenGL ES drawing issues in Android NDK

Due to performance issues, I have had to transfer my android opengl code from Java to C. I believe I transfered all of the OpenGL code, but I now have many errors with the section of my code that draws a bitmap as a texture to the screen. When I run the project in an emulator, the current code does not display anything and appears to h...

OpenGL ES view: how to orient it to landscape?

Looking for clues about orienting an OpenGL ES app in landscape, most information I found dates back from 2008, most of it refering to the early versions of the SDK. Apparently, back in the days, in the case of GL it was recommended to not rotate the view, but instead to apply the rotation as a GL transformation. Is it still the case wit...

turn a line into a rectangle

I have a method that draws a line between two points. This works pretty well, but now I want to make this line into a rectangle. How can I get the points on the left and right side of each of the line points to make it into a rectangle that I can draw? It is almost as though I need to somehow figure out how to get perpendicular lines ...

Drawing Stippled Lines using OpenGL-ES

I have an application that draws 3-d map view marked up lines that show various features. I am porting the map over to an OpenGL-ES architecture, but am having a bit of trouble working out how to display dashed lines. Doing a lot of googling, I've found many references to the idea that drawing dashed lines and polygons were removed from...

Floating Point Textures in OpenGL ES 2.0

I've been trying to figure out how to use float textures in GLES2. The API Reference (http://www.khronos.org/opengles/sdk/docs/man/glTexImage2D.xml) says that only unsigned bytes and shorts can be used, but i've seen people saying it is supported elsewhere. I could use GL_LUMINANCE as the texture format but that only gets me one float v...

Landscape mode and locationInView in opengl es

So today I implement landscape mode for my app. It is an opengl es application. I rotated it 90 degrees. The first thing I notice is that the touches no longer work. The reason being is that the call to locationInView is still giving the coordinates as though the application is in portrait mode. How do people typically deal with this...