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
0
votes
0 answers
How to read pixel from a rendered texture (colorattachment)
I rendered color and position textures to colorattachment0 and colorattachment1 in a fbo. The color texture is being drawn onto a cube for differed rendering. I need to read from the position texture though, which I sent to colorattachment1. Here is…

Deniz Cetinalp
- 901
- 1
- 18
- 34
0
votes
1 answer
OpenGL recording frame buffer for 10 seconds and replay
I am trying to make some OpenGL code to record 10 seconds of frame buffer and replay after recording is done.
What I am currently thinking is using glReadPixels and glDrawPixels on system memory. For 640 x 480 USB camera input stream, 10 seconds…

diehard98
- 232
- 4
- 14
0
votes
1 answer
OpenGL ES 2.0 Android - Color Picking
I'm trying to implement color picking using GLES20.glReadPixels function in android OpenGL ES. The problem is that this function is always returning 0,0,0,0 as color and not the correct color values. Any idea why? My code looks like this:
public…

L3M0L
- 429
- 8
- 23
0
votes
0 answers
Read bytebuffer from specific area on the screen
I'm trying to read the pixeldata from multiple predefined squares on the screen. However for some reason the bytebuffer that gets returned is the same for whichever square I choose.
This is the function I'm using:
private void loadByteBuffer()
{
…

user1870238
- 447
- 7
- 20
0
votes
0 answers
OpenGL, wait for output to be displayed on screen
I'm trying to draw a few images on a GLWindow and then after they've been drawn, read them into a bytebuffer. The displaying part works fine and the image reading works too, but they don't seem to play nice together.
public void…

user1870238
- 447
- 7
- 20
0
votes
1 answer
GPUImage Harris Corner Detection slow due to glReadPixels
I see that glReadPixels is a major bottleneck when reading the black image with white dots for Harris corners. FPS drops from 30 to 15. Is it possible to obtain the coordinates of corners without glReadPixels and GPUImageCrosshairGenerator? I know…

john
- 1
0
votes
0 answers
Android GLES, how do I read texels? (In any format)
I've been searching around for hours and can't find a way to read pixel data from a texture in any format.
glReadPixels either returns all 0s or needs a texture to be rendered to the framebuffer (which also seems to be a mystical function with no…

Rogod
- 188
- 1
- 13
0
votes
1 answer
glReadPixel() return black image
I'm using AVCaptureSession for live cameraview feed then i render some images on the camera overlay view. I didn't use any EAGLView, just overlaying some images using AVCaptureSession with previewlayer. I want to take screenshot live camera feed…

user3496826
- 101
- 2
- 14
0
votes
2 answers
Issue using glReadPixels result
For a homework assignment, I need to implement a floodfill algorithm. My code is already structured, but I can't seem to figure out why my glReadPixels section isn't working. I was hoping someone could take a look at what I'm doing and let me know…

Brian Rodriguez
- 487
- 3
- 10
0
votes
1 answer
glfwOpenWindow and glReadPixels modes?
Suppose I open a glfw window with:
glfwOpenWindow(width, height, 8,8,8,8,8,8, GLFW_WINDOW);
Then, I try to read it back with:
glReadPixels(0, 0, width, height, ..1.., ..2..);
I'm not sure what I should be putting in as ..1.. and ..2.. ; I think…

anon
- 41,035
- 53
- 197
- 293
0
votes
1 answer
high resolution snapshot in opengl with framebuffer
i am using opengl to set texture to 3d object.then snapshot and blend it other picture.
i wanna to high resolution snapshot(3000*1500 px). is it possible in opengl?
my code is:
glClear(GL_COLOR_BUFFER_BIT |…

mahdi_12167
- 491
- 4
- 9
0
votes
1 answer
Calling multiple glReadPixels & glDrawArrays on a FBO, in Opengl ES
In OpenGL ES, is it possible to call glReadPixels and glDrawArrays on a FBO several times one after the other?
The issue I'm facing is that I'm getting the image all garbled.
Sample Code:
// Activate Off-Screen FBO
glBindFramebuffer(GL_FRAMEBUFFER,…

PerracoLabs
- 16,449
- 15
- 74
- 127
0
votes
1 answer
glReadPixels is reading from the wrong location
I am trying to read the color of a rectangle drawn on the screen, but when I try to read from a coord, it appears that it reads it from an offset but this offset is not consistent. (I am using the SDL2 library in case that helps) I have found that…

Matt Hirdler
- 95
- 1
- 10
0
votes
1 answer
Fastest way to read back from OpenGL ES 2.0 / 3.0
What is the fastest way to get data back from the OpenGL context? At the moment I am rendering to a texture and read back the result using glReadPixels().
On a Samsung S3 Mini (I8190, Android 4.1.2, GPU Mali-400 MP, CPU NovaThor U8420 DualCore) it…

Friedrich
- 645
- 11
- 26
0
votes
2 answers
Using glReadPixels to read value at Tap Point ? OpenGL 2.0 iOS
Say I have a square which is defined as follows :
typedef struct {
float Position[3];
float Color[4];
} Vertex;
const Vertex Vertices[] = {
{{2, 0, 0}, {1, 0, 0, 1}},
{{4, 0, 0}, {1, 0, 0, 1}},
{{4, 2, 0}, {1, 0, 0, 1}},
{{2, 2, 0}, {1, 0, 0,…

GuybrushThreepwood
- 5,598
- 9
- 55
- 113