opengl-es

Unloading vertex buffers in OpenGL

I have an Android live wallpaper that I suspect is leaking memory, probably either textures or vertex arrays. I'm calling glDeleteTextures on my texture IDs, but don't see any sort of equivalent for my vertex buffers. I'd like to be able to be sure both my textures and buffers are getting unloaded by OpenGL, am i missing something? Th...

How to modulate every texture unit in OpenGL ES 1.1?

I have two textures and a "blend factor", and I'd like to mix them, modulated by the current color; in effect, I want to use the following shader: gl_FragColor = gl_Color * mix(tex0, tex1, blendFactor); I'm using OpenGL ES 1.1, targeting all versions of the iPhone, so I can't use shaders, and I have two texture units. My best attem...

Opengl ES and texcoord

Hi, I've got some code which I would like to translate into Opengl ES. I'm not experienced with it however, so here it goes. The original code does a loop like this: glBegin(GL_TRIANGLES); for(i=0; i<num_triangles; i++) { glNormal(...); glTexCoord2f(...); glVerted3fv(...); glTexCoord2f(...); glVerted3fv(...); glTex...

How to implement "circular side-scrolling" in my game?

I'm developing a game, a big part of this game, is about scrolling a "circular" background ( the right end of the Background Image can connect with the left start of the Background image ). Should be something like this: ( Entity moving and arrow to show where the background should start to repeat ) This happens in order to allow to...

Does mixing Quartz and OpenGL-ES cause big performance degrade??

I have a plan to make a game using OpenGL for 3D world view, and CALayer(or UIView) for HUD UI. It's easy to imagine performance degrade from mixing them, but the document which mention this impact disappeared: http://developer.apple.com/iphone/library/technotes/tn2008/tn2230.html I cannot find the document on current version of SDK refe...

Display points with (x, y, z) coordinate in 3D on an iPhone?

Hello, I have 40 points with (x, y, z) coordinate in my iPhone app. For now I just NSLog them. But I'd like to display them in... 3D! How can I do that? Do I have to use openGL ES? What are the others possibilities (if there are any)? I've never used 3D in programming... is this a difficult thing to do? Thanks ! ...

Choosing OpenGL ES 1.1 or 2.0 - what should my iPhone AR app use?

I am trying to choose between implementing OpenGL ES 1.1 and 2.0 for my augmented reality app, which is only available on the iPhone 3GS. About what we'll be doing: 1 -We are moving to OpenGL because CoreAnimation was exceptionally slow, and we'll be able to create a richer user experience. 2 - Our plans are to create a 3D environment...

How to set image on EAGL VIEW

hi, I want to put images from my photo library in to the EAGL view for some further processing. The image that are already in our resources folder will be taken by itself but mltiple or images from photo library can't. So any one knows how to put image on EAGL view in open GLES. Regtards viral ...

Is there any short hands on converting Apple's touch coordinate to openGL coordinate?

I know that the Apple we use the left top point as 0, 0. but OpenGL use left button as (0, 0), is there any short cuts to convert Apple's coordinate to openGL's one? thz. ...

How to create a transparent glass cup in OpenGL ES/OpenGL?

Hi there! Is there a way to create a glass cup with OpenGL ES/OpenGl? And if it's possible, what can i read to start creating? Need to get the most realistic view of a glass, for example - see glass cup image For simplicity, without handles. Maybe, anybody has example with sources? Thanks. ...

Parallax backgrounds in OpenGL ES on the iPhone

I've got basically a 2d game on the iPhone and I'm trying to set up multiple backgrounds that scroll at different speeds (known as parallax backgrounds). So my thought was to just stick the backgrounds BEHIND the foreground using different z-coordinate planes, and just make them bigger than the foreground (in size) to accommodate, so th...

loading multiple images( textures) on the screen.

Hi. I need help on openGL android. I am trying to create a small application which shows texture of four bitmap moving on the screen. Basically the application has 4 bitmaps which are moving one after the other depicting a moving picture. Can somebody help me on this ASAP. ...

Fastest possible way to render 480 x 320 background as iPhone OpenGL ES textures

I need to display 480 x 320 background image in OpenGL ES. The thing is I experienced a bit of a slow down in iPhone when I use 512 x 512 texture size. So I am finding an optimum case for rendering iPhone resolution size background in OpenGL ES. How should I slice the background in this case to obtain the best possible performance? My ma...

Draw a smooth line with finger touch on iPhone

Hello Everyone, How do I draw a smooth line with a finger slide/touch motion on the iPhone? I have the following code but it is not smooth. It makes corners/turns for example when I try to do a circle. I think I have to use OpenGL. Any ideas? sample code? tutorials? Thanks! UIGraphicsBeginImageContext(self.view.frame.size); [draw...

OpenGL ES displaying HUD display has no color on top of textured 3D objects

Im a beginner on iphone OS development. I followed jeff's tutorial here about hud display in iphone OS http://iphonedevelopment.blogspot.com/2010/02/drawing-hud-display-in-opengl-es.html The sample works on the accompanying project with the isocahedron as the background of the HUD and the is working as expected with colors and the text....

Optimizing texture swapping on opengles for the iPhone

I have 2 1024x1024 sprite sheets, one containing several 480x320 background images and another containing a variety of smaller elements as entities and interface. My framerate drops like a rock whenever I enter a scene in which I have to display sprites from both textures (forcing me to re-bind twice per frame, interface texture->bg text...

Trying to Resize Eaglview Displayed Image Dependent on Landscape or Portrait Photo

I've been trying to figure out how to resize the drawing view on eaglview as opposed to the default 320x480 dimension. My Eaglview is attached to a UIViewController. What I really want to do is find out where viewrenderbuffer is calling its width and height parameters from. In the code below I can see that the backing width and height a...

My 3D object (opengl es) is disappearing behind the iPhone camera view

I have an augmented reality iPhone app that I am converting from Core Animation to OpenGL ES 1.1. I have added code that has been modified from the Apple OpenGL template. My problem is that my 3D object , when translating along the negative Z-axis (away from the user), appears to disappear into the camera view, until its completely gon...

OpenGL ES displaying HUD display Text can't be colored black on top of textured 3D objects

This is a follow-up of this question on here http://iphonedevelopment.blogspot.com/2010/02/drawing-hud-display-in-opengl-es.html It tackles on the HUD (heads up display) which is based on this tutorial > http://stackoverflow.com/questions/2681102/opengl-es-displaying-hud-display-has-no-color-on-top-of-textured-3d-objects I wanted to set ...

iPhone OpenGL ES freezes for no reason

Hi, I'm quite new to iPhone OpenGL ES, and I'm really stuck. I was trying to implement shadow mapping on iPhone, and I allocated two 512*1024*32bit textures for the shadow map and the diffuse map respectively. The problem is that my application started to freeze and reboot the device after I added the shadow map allocation part to the co...