Questions tagged [glreadpixels]

glReadPixels is an OpenGL API function to read pixels data from source framebuffer to destination memory buffer. When FBO is supported, the source could be FBO; when PBO is supported, the destination could be PBO.

200 questions
1
vote
2 answers

glReadPixels seems to read at the wrong coordinates in Qt

I'm trying to develop an application using OpenGL 4.0 and Qt 5.3 and I want to implement color picking to select different models in a QGLWidget. So basically, when I detect a mouse click, I: Get the position of the mouse Render the scene Set a…
Gpack
  • 1,878
  • 3
  • 18
  • 45
1
vote
1 answer

glReadPixels: Stack around variable was corrupted after read pixels

I am trying to use glReadPixels() to read a window of 5 * 5 pixels. Here is the code. const unsigned int WINDOW_SIZE = 5; const unsigned int NB_COMPONENTS = 3; GLubyte array[NB_COMPONENTS * WINDOW_SIZE * WINDOW_SIZE]; glReadPixels( 0, 0,…
Milo
  • 145
  • 1
  • 7
1
vote
1 answer

glReadPixels() memory leak in opengles?

I encounter glReadPixels memory leak issue.Please See the image attached notice the area marked with red lines.malloc free pair memory is OK,but an extra 3M memory is allocated by glReadPixels, I have read from doc glReadPixels official doc which…
kobunketsu
  • 157
  • 2
  • 10
1
vote
0 answers

glreadpixels pixels cut off and show black part, when using opengl es 3.0 PBO on Android 4.3

i'm trying to do fast pixels reading by using PBO with opengl es 3.0 on Android 4.3. my device resolution is 1280 * 720. after called glReadPixels() and fetched pixels data, i encoded data to JPEG file. problem is , original opengl image would be…
0xw
  • 11
  • 3
1
vote
1 answer

Get pixel behind the current pixel

I'm coding a programm in C++ with glut, rendering a 3D model in a window. I'm using glReadPixels to get the image of the scenery displayed in the windows. And I would like to know how I can get, for a specific pixel (x, y), not directly its color…
Demod
  • 53
  • 1
  • 1
  • 8
1
vote
1 answer

LWJGL Using PBO for reading pixels fail

I'm trying to read from the framebuffer Asynchronously but glReadPixels() generates an INVALID_OPERATION error. I've read what might cause this error but i haven't found any problem in my code: int PBOHandle = glGenBuffers(); // PBOHandle != 0 …
Mk3Y
  • 35
  • 5
1
vote
0 answers

Android glsurfaceView - setScaleX() not working/not Stretch the view

This is my final technology issue that i have to complete my 4 month of work on my app. I will try to be simple as i can,because i need specify solution. My problem: In short: i need the stretch my glSurfaceView I am using custom glsurfaceView,that…
yarin
  • 543
  • 1
  • 5
  • 18
1
vote
1 answer

glReadPixels moving coordinates with zoom

I'm trying to read a rectangle of pixels by selecting two points (opposite corners) using glReadPixels with C++ code. The problem comes out when selecting the Y-Axis value. At the moment, I manage to get the glReadPixels work until zooming. When…
Tarkal
  • 28
  • 3
1
vote
1 answer

How I can get the transparent color of one pixel in Opengl ES?

In the renderer of OpenGL I try the following code: ByteBuffer buf = ByteBuffer.allocate(1 * 1 * 4); GLES20.glReadPixels(60, 100, 1, 1, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, buf); float red = buf.get()/255.0f; float green =…
Samuel Liz
  • 49
  • 8
1
vote
1 answer

glReadPixels failed with format GL_ALPHA

I wanna draw font on the android game by the freetype library. Get the glyph texture by the library and upload to the FBO, which i used to rendering the string label; when i run this code, it would be ok, and i get the excepted data, the font shows…
codeplay
  • 620
  • 1
  • 6
  • 19
1
vote
1 answer

OpenGL + CUDA: Transfer data from glReadPixels() to CUDA

I create an image with openGL and read it whit glReadPixels(). Now, I want to analyze that data. I want to parallelize the loop that run on each pixel and check its color by CUDA. The problem is that I need to pass the data from the GPU to the…
hydrogn84
  • 49
  • 3
1
vote
1 answer

glReadPixels when using PBuffers is failing in some android devices

I'm facing a problem with some opengl ES drivers, when calling glReadPixels for a Pbuffer some devices will just kill the app with no message at all. Others will give me the next trace and then freeze for around 10 seconds before killing the…
PerracoLabs
  • 16,449
  • 15
  • 74
  • 127
1
vote
0 answers

Modify an existing opengl application to render to a PBO (and from there to a file)?

I want to modify an existing OpenGL application to render to a PBO and then read the PBO to generate an encoded video of what was originally going to be rendered to the screen. Since performance is key, I cannot stall the pipeline by doing…
cloudraven
  • 2,484
  • 1
  • 24
  • 49
1
vote
1 answer

OpenGL + QT: render to texture and display it back

After some trouble I've managed to correctly render to texture inside a Frame Buffer Object in a Qt 4.8 application: I can open an OpenGL context with a QGLWidget, render to a FBO, and use this one as a texture. Now I need to display the texture…
nkint
  • 11,513
  • 31
  • 103
  • 174
1
vote
2 answers

Displaying a screen shot generated UIImage is not displaying in UIImageView (for device only)

I am trying to save an OpenGL buffer (whats currently displayed in the view) to the device's photo library. The code snippet below works fine on the simulator. But for the actual device it is crashing. I believe there could be a problem with the way…
AlvinfromDiaspar
  • 6,611
  • 13
  • 75
  • 140