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...
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...
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...
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...
A simple question, does the error code 0x0500 mean anything besides there was an error?
...
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?
...
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);
...
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...
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 ...
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...
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?
...
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...
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 ?
...
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...
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...
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
{
...
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...
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...
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...
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...