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.
Questions tagged [glreadpixels]
200 questions
3
votes
2 answers
opengl stencil buffer not initialized with zero?
I work under MS WindowsXP,my video card is itel GMA4500,
my code:
glClearStencil(0);
glClear(GL_STENCIL_BUFFER_BIT);
unsigned char* data = new unsigned…

user897101
- 31
- 1
3
votes
1 answer
optimal pixel-read back strategy
I need to render certain scenes and read the whole image back in main memory. I've search for this and it seems that most video cards will accelerate the rendering but the read-back will be very slow. After a bit of research i only found this card…

lurscher
- 25,930
- 29
- 122
- 185
3
votes
2 answers
how to Rotate image by 90' degree using pixel data of the image?
Currently i m capturing the screen using the glreadpixels(). the image captured is generally mirrored image hence i flipped back the image to normal.
Now i want to rotate the captured data (image) by 90'degree.
any idea how to do that ?
The code i m…

Tornado
- 1,069
- 12
- 28
3
votes
3 answers
screenShot code Not working on ipad, works on iphone
i am having this strange problem...
i had to capture the screen data and convert it into an image using the following code..this code is working fine over iphone/ipad simulator and on iphone device but not on iPad only .
iphone device is having ios…

Tornado
- 1,069
- 12
- 28
3
votes
1 answer
Screencapturing using glReadPixels results in shifted pixels in some window resolutions
I am using GLUT for my windowing system to output some images onto the screen.
I also want to output the images to files. This has been a challenge. In some window resolution (such as 256x256, 1024x1024, 1920x1200), glReadPixels produce exact same…

Adam Lee
- 2,983
- 7
- 35
- 47
3
votes
1 answer
OpenGL ES 2.0 :glReadPixels() with float or half_float textures
I am writing an OpenGL ES 2.0 app for the iPhone (iOS 4.1). At the end of the computations, which are done in the shaders, i need to write back some data to the CPU. As far as I know this can be done by glReadPixels(). In order to keep precision, i…

Lars
- 320
- 1
- 4
- 13
3
votes
1 answer
Implementing render-to-vertex-array, glReadPixels fails (invalid operation)
I'm trying to copy vertex data from a texture to a vertex buffer, and then draw the vertex buffer. As far as I know the best way to do this is to bind the texture to a fbo, and use glReadPixels to copy it to a vbo. However, I can't seem to get this…

doeke
- 462
- 5
- 12
3
votes
2 answers
glReadPixels depth_buffer_component always returns 1
I'm trying to get world coordinates from any of my rendered vertices in OpenGL window (I prefer to use GLUT library). The problem is when I'm calling glReadPixels function to get depth value of a vertex, it always returns a 1 value, when I'm…

Viktor Pizhun
- 33
- 4
3
votes
3 answers
Reading Pixels in WebGL 2 as Float values
I need to read the pixels of my framebuffer as float values.
My goal is to get a fast transfer of lots of particles between CPU and GPU and process them in realtime. For that I store the particle properties in a floating point texture.
Whenever a…

Feppster
- 101
- 1
- 7
3
votes
1 answer
reading pixel data from framebuffer
Im writing an interface in qt using opengl and I have a QGLWidget that has some vertices drawn to the screen.
Im trying to change the pixel data to make the image brighter however glreadpixels is giving very bizarre results
im reading the pixels…

BKreger
- 89
- 1
- 1
- 11
3
votes
1 answer
webGL readPixels and FireFox 35
I have updated to FireFox35 and the following code is not working anymore:
var ctx = renderer2.getContext("experimental-webgl",{preserveDrawingBuffer: true}) || renderer2.getContext("webgl",{preserveDrawingBuffer: true});
…

Minichua
- 185
- 14
3
votes
1 answer
unable to read depth values from depth texture attached to FBO
I am unable to read correct depth values from depth texture using glreadpixels function. FBO status is complete. other render targets also look fine after blitting to another FBO.
code snippet:
// Create the FBO
glGenFramebuffers(1,…

user942502
- 111
- 1
- 7
3
votes
1 answer
OpenGL ES2.0 glReadPixels() is very slow
I am using glReadPixels to read the pixels from FBO to memory.
Here is the code:
UINT8* data;
glBindFramebuffer(GL_FRAMEBUFFER, FBOID);
glReadPixels(0, 0, w, h, GL_RGB, GL_UNSIGNED_BYTE, data);
I found this operation is very very slow... Is there…

John
- 697
- 1
- 10
- 33
3
votes
1 answer
How to save picture (applied glsl effects) captured by camera in Android?
I have applied some effects to camera preview by OpenGL ES 2.0 shaders.
Next, I want to save these effect pictures (grayscale, negative ...)
I call glReadPixels() in onDrawFrame(), create a bitmap based on the pixels I read from opengl frame buffer…

Justin
- 115
- 3
- 9
3
votes
2 answers
glReadPixels on iOS with multisampling
I'm trying to get pixels from framebuffer with multisampling. It returns only zeros. I do call glResolveMultisampleFramebufferAPPLE as suggested here and here, but I can not figure out whats the problem in my case.
first of all I create…

medvedNick
- 4,512
- 4
- 32
- 50