opengl-es

Open GL + Applying Brightness on the Image + Undo Brightness operation

Hello All, I am working on one module of application. in this I need to perform brightness operation on the image [ I have done this using OpenGL ES ]. Now I am stuck on how to revert back this brightness operation if in between user clicks "Cancel". As I am drawing on same layer for brightness operation. I am new to OpenGL and might...

Contrast using Open GL ES

Hello All, I am trying to do contrast on image using Open GL ES. following is code for contrast in the source code [sample from apple] regarding same. but seems like I am not getting desired output. -(void) DoContrast:(float) aContrast { GLfloat h = aContrast*0.5f; [EAGLContext setCurrentContext:context]; glBindFramebuff...

On Android with opengl-es, should I put all glVertexPointer data into one buffer?

I have a scene that contains a bunch of objects, for example lets say it's a simple grid of tiles. So there's a main "border" object, and then (rows x columns) cells. For simplicity, assume each cell is a simple four-segment line consisting of a four-node GL_LINE_LOOP. Currently, my frame rate is awefull, and it seems to sit in all th...

Which iPhone OpenGL statistics are accurate on 1g devices?

I'm loading a lot of textures as part of my app. I load them on a "load-thread" and use them on my main thread using another GL context and the 'shareContext' mechanism. I'm using the OpenGL ES instrument to see what's going on and it is reporting that over 2x the number of textures I've actually allocated are resident. In other words...

OpenGL ES 1.1 reporting 0x0500 error

A simple question, does the error code 0x0500 mean anything besides there was an error? ...

OpenGL when turning Android Phone

What is it called ( what term should i google) when flipping/tilting the phone, so that the view rotates when running android? My (OpenGL) application crashes when I do this, are there some certain steps you should do when handling OpenGL when this occures? Is there something else I might want to think about? ...

iOS 4.1 OpenGL ES 1.1 not drawing Texture

For some reason my texture are not drawing, even though my code looks exactly the same as an old project that did. So far, the vertexes and TexCoords look fine, as I am having white squares being drawn, where the texture should be drawn instead. The process so far goes, I load up a Contoller and in loadView, I glEnable(GL_TEXTURE_2D); ...

openGL fading background

I'm trying to create a particular effect where I have a bunch of particles on the screen which leave trails that slowly fade. I was hoping that I could simply use glClear with a small alpha value to do this but that doesn't seem to be working. My second idea was to draw a black face on the front of the screen but this doesn't seem to be...

Android + OpenGL ES pixel question

Hello i have been trying to create some simple games lately using the Canvas drawing methods for 2D graphics. Now i want to start programming with OpenGL, i have created the GLSurfaceView but i'm having much trouble understanding the layout and how your moving around the screen with floats. My easiest option would be to make some kind ...

How to use an OpenCV rotation and translation vector with OpenGL ES in Android?

I'm am working on a basic augmented reality application on Android. What I did so far is detect a square with opencv and then using cvFindExtrinsicCameraParams2() I calculated a rotation and translation vector. For this I used 4 object points, which are just the corners of a square around (0,0,0) and the 4 corners of the square in the im...

OpenGL desktop application to iPhone

I want to develop OpenGL application for iPhone. However I don't like using iPhone simulator. Is it possible to create Cocoa desktop application and then just copy-paste drawing code to iPhone application? How different is coding OpenGL for iPhone and Cocoa? ...

Coloring twice in OpenGl es

hello i m doing color picking for my project, i m working with iphone sdk and my project substantially(for color picking part) load 3d models with texture, the "loader" own an array of objects, those objects are presented with drawView and are updated with redrawView. When i click with mouse on the iphone simulator i just call the method...

Opengl es glReadPixels

if i write glColor4f(1.0,0,0, 1.0); glReadPixels(touch1Point.x,viewport[3]-touch1Point.y, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &pixelColor[0]); pixelColor return 255 , 0 , 0 what is the right glReadPixels call that give me back 1.0 0 0 ? ...

Using a global vertex cache and still take advantage of glRotate?

I have a simple Android OpenGL-ES app, and as all the models are very simple (<10 vertices!) I have implemented a global "world" class that tracks all the vertices, and performs a single pair of GL commands on the frame rendering. Each model object adds it's vertices to the global buffers, and these these are 'sent' to GL in one operati...

Can the EAGLContext get lost on an iPhone?

I have a number of user reports saying that sometimes one of our games is running, but the screen is not updating. I've not been able to recreate this by playing the game, however when I purposefully set the EAGLContext I am using to nil I get the same effect. Does anyone know if there are conditions when the EAGLContext gets lost on an...

glReadPixels crashes on specific render buffer widths

I need to read content of CAEAGLLayer, which has various widths and heights (based on background image size). on iPad emulator everything is okay, but on device I have crashes or weird horizontal lines instead of content. Crashes not happens on width, for example, from 537 to 544 pixels I'm using following code - (UIImage*)image { ...

How do I setup vertices for a rectangle?

I need to setup vertices for a rectangle - I have a square example, how would I modify it to get a rectangle 5 times the width and half the height? /** The initial vertex definition */ private float vertices[] = { //Vertices according to faces -1.0f, -1.0f, 1.0f, //v0 1...

Android OpenGL video capture

Does anyone knows some convinient method to capture video to file or stream from OpenGL app on Android device? For example, can we capture video from a view, opengl view? I just found out the following: 1) We can get frames using glReadPixels. (No video on this step?) 2) MediaRecorder can encode video, but how can we provide it our r...

WebGL/GLSL vertex shader collapses 9 points into single point when I set x coord of gl_Position to zero

I do not understand why the following two shaders produce different results when I render a vertex buffer with x coordinates equal to zero: First: attribute vec3 position; void main() { gl_Position = vec4(position.x, position.y, 0.0, 1.0); } Second: attribute vec3 position; void main() { gl_Position = vec4(0.0, position.y, 0.0...

OpenGL ES use of glColor4f in Multi-texturing

What I'm trying to do is output a masked texture on an iPhone using OpenGL ES 1.1. The default combining behavior seems to work to my advantage until I actually want to vary the ALPHA of the final result! The 'a' (Alpha) float variable has no effect here: (Everything else outputs fine, it's masked and drawing nicely aside from the alp...