opengl-es

Rendering overlapping translucent objects without darkening overlap

I'm not sure if there's a name for this, but essentially what I need to do is take two opaque sprites, draw them both at 50% opacity, and where they overlap, don't have it look darker. The image on the left is how it's rendered originally. Then, I want to decrease the alpha of the rendering, and by default, I get the image in the mid...

OpenGL ES recommended way of displaying a background image

Whats the recommended way of displaying a background image in an OpenGL ES app. UIImage added to view hierarchy underneath glview? image drawn in OpenGL draw routine from texture in memory? Are there any performance / memory considerations to take account of? ...

Enlarging Textures in Android OpenGL ES ?

Hi All, I have a small issue. I need to enlarge(Zoom) Textures when I hold&drag at the corners. I am using glOrtho() to setup ModelView. gl.glOrthof(0.0f, screen_width, -screen_height, 0, -1.0f, 1.0f); //Map exact pixel to World Co-od I am able to do hit-test and detect corners of the images(Textures) on the screen. Now I need to en...

Can I make a rather native C++ app with Android?

I'm interested in the following features: Writing an app for Android Market that is written completely in C++ (a port of existing product actually). Use fast screen-buffer pixel pushing (or rather using OpenGL ES for this). Grab user input and direct it to C++ code. Is it legal to write such an app for Market? Is Market policy someho...

Is that a right way using premultiplied alpha to do alpha blending in GL-ES?

As I know alpha composition uses straight alpha basically. But all GLES blending sample codes I've seen are using premultiplied alpha. Is this correct and right way to do this? Is premultiplied alpha a regular way in real-time graphics? ...

how to set/get pixel on a texture in OpenGL ES on iPhone?

I am trying to Google for what I've mentioned in the title, but somehow I couldn't find it. This should not be that hard, should it? What I am looking for is a way to gain access to an OpenGL ES texture on iPhone, and a way to get/set pixel with it. What are the OpenGL ES functions I am looking for? ...

iPhone OS - Screenspace to world space conversion

I am currently trying to convert a touch from screenspace, to where it is in worldspace for a 2D game I am working on. The view I am working on has nearly the same coordinate system as the screen, basically if someone touches the x = 345, y = 500 pixel on the screen, it will be the same on the view, although the y will be backwards beca...

Fillrate Issues on Android Emulator

I'm getting very low framerate with OpenGL ES. If the model is far from the camera I get like 35 fps, but if it fills entire screen (say, a skybox) I'm getting 6-8 fps. It even happens when rendering a skybox alone and nothing else. Is that actually an issue with the emulator? I'm using Windows XP SP3 on a AMD Athlon 64 Dual Core 3800 ...

OpenGL ES 2: Uniforms and attributes

Hi! It's well known that uniform and attributes are registers in GPU. And my question is what happens when different program bound? Does standard guarantee that previously set uniforms and/or attribute pointers will be reloaded or I need to reload them manually in any case? I want to create caching system. It seems for me that attribute...

Storing texture name in objects - obj-c

I'm in the process of learning opengles / obj-c and creating an app for the iphone that will render multiple 3d models. I've created an object that stores all the important details such as vertices / faces / textures etc but I also want to store the texture name that is currently being used on the model. In my CustomModels.h file I have:...

Is it possible to do old school 2d blitting on modern GPU?

Hi, It looks like GL has become mainstream for all gaming platforms (even handheld!) This has pushed the deployment of modern GPU chipsets to large numbers of consumers. This is amazing. With the modern GPU systems out there now, is it possible to do generic old-school graphics programming (aka - blit from X rect to Y rect using VRAM...

Is there a way that I can make a program like GLPaint using CGContext?

I want to make a program similar to GLPaint using CGContext that is very smooth and easy to put images behind. I understand that GLPaint has no allowance for putting an Image behind the painting canvas, rather than having just a black one. ...

Transparent texture in OpenGL ES for Android

I'm trying to set the transparency of a texture on a quad in opengl, playing with the blend functions didn't help neither did anything on google. Any suggestions? ...

convert an array of NSValues / CGPoints to a CGPoint struct for use with glDrawArrays in cocos2d

Hi there, I'm pretty new to Objective-C and even C in general here, so please bear with me. My main goal is to display my NSMutableArray of CGPoints (via NSValue) with glDrawArrays(GL_LINE_STRIP, 0, points); I noticed that cocos2d requires an array(?) pointer *poli like so: void ccDrawPoly( CGPoint *poli, int points, BOOL closePolyg...

How do I texture map a cube in OpenGL ES?

Having a lot of trouble getting texture maps to work in openGL ES (iphone). Here's what I've done: built an array of vertexes built an array of faces that reference the indices of the array of vertexes for each face built an array of colors so I can be sure I know which vertex on the cube is which. All of this following Jeff Lamarc...

Time Steps in Android OS 1.6 using OpenGL?

I'm trying to port one of my OpenGL/Glut programs over to Android 1.6. I used GLut extensively due to my classes teaching glut. Is there an alternative to glutTimerFunc or replacement for using glutTimerFunc? Also, any ideas where I can replace glutMainLoop? From looking at a few examples, onDrawFrame what I should be looking at? ...

How do I change or animate texture maps on openGL ES 1.1 objects?

I'm building a game that has an array of 7 * 5 tiles, similar to Scrabble tiles. The two main faces are supposed to have different letters on them. I've created a single geometry that I reuse by translating in x and y. I can change the letter that is mapped to the face of ALL the tiles, by setting the values in my glTexCoordPointer. My ...

iPhone SDK - Get image from camera/camera roll, process w/ OpenGLES

I am writing a basic image processing app. Right now I have code in place to load an image via the Camera or the image picker and set it as the source image for a UIImageView object in my interface. The object is configured with the "Aspect Fill" property, so I don't have to programmatically crop the image. Looking at the sample code pr...

3D polygonal triangulation in opengl es

im looking for any information about a builtin algorithm in opengl es to convert a 3d polygon in a triangle set. is there anything implemented like that in opengl es? ...

Constant opacity with glBlendFunc on iPhone

What glBlendFunc should I use to ensure that the opacity of my drawing is always the same? When I use glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) and multiple images are drawn on top of each other, the result is more and more opaque until it's completely opaque after a certain number of imgaes. The closest I have come is to use gl...