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
1
vote
1 answer
How to glReadPixels properly to write the data into QImage in Linux
Summary
I want to write the opengl pixels(GL_RGB) by glReadPixels to a QImage.This renders correct, but when i resize the window, it scales weird and distorts my shape(triangle).
What i tried
I tried…

kostas petsis
- 49
- 8
1
vote
1 answer
getting a crash while using glReadPixels to map texture in memory
I'm trying to use glReadPixels to map a texture in memory to be able to use openGL's immutable storage feature.
I'm using deferred shading so I prepare my G-Buffers as following:
glGenFramebuffers(1, &_gBuffer);
glBindFramebuffer(GL_FRAMEBUFFER,…

user6138759
- 107
- 5
1
vote
0 answers
Issue with glReadPixels from GL driver / Chrome & Atom both crash when link is clicked in Atom
I'm just getting up and running with a fresh install of Ubuntu 19.04. Running into some unusual behavior with Atom.io and Chrome. Whenever I click a link in Atom, both Atom and Chrome crash out. When they restart, the link is open on Chrome. I've…

CreationTribe
- 562
- 1
- 5
- 17
1
vote
1 answer
Possible to read a single sample from MSAA FBO?
Using OpenGL to draw objects and also have my fragment shader outputting a scalar integer ID. For drawing the objects, I'm using multi-sampling for anti-aliasing, so when I create the buffer for the integer ID, I have to create it as an MSAA buffer…

Dtor
- 590
- 2
- 9
1
vote
1 answer
glReadPixels crash on iOS
When the online user just opened the app, even now this collapses, and we can not reproduce ourselves. crash info:
libsystem_platform.dylib 0x183223b40 _sigtramp + 36 (sigtramp.c:109)
AGXMetalA10 0x1a2ce15d8…

Michael.lai
- 76
- 7
1
vote
1 answer
gl readPixels coordinate system: read and check more than one point
I need to read a block of pixels from the picking buffer to check the surrounding points for collisions, like in the picture below:
I am clicking on my canvas at x, y - so I define a square region of, let say, 11x11 pixels, centered at cX, cY and…

deblocker
- 7,629
- 2
- 24
- 59
1
vote
1 answer
iPhone OpenGL ES: glReadPixels not working
I trying to implement a simple picking function using glReadPixels however when I click on an object that is 1 colour, I get different values back depending on where I clicked on that object? There not special lighting etc? Whats going on? …

Burf2000
- 5,001
- 14
- 58
- 117
1
vote
0 answers
PyQt5: can't figure out how to call glReadPixels
I'm trying to use glReadPixels in a QOpenGLWidget class (Qt 5.8.0, PyQt 5.8.0, python 3.6.1), but can't figure out how to access the function.
Here's a segment of my code:
self.vp = QOpenGLVersionProfile()
self.vp.setVersion(2,1)
self.glFunc =…

GlowingApple
- 11
- 3
1
vote
1 answer
Problems using glReadPixels with GLSL
I`m trying to render some particles and save the scene to a bmp file,
here is my code
// vertex shader
const char *vertexShader = STRINGIFY(
uniform float pointRadius; // point size in world space
uniform float pointScale; // scale to calculate…

SenWang
- 19
- 1
1
vote
1 answer
PBO on Android doesn't improve glReadPixels performance
I want to take screenshot of current frame in OpenGL for further processing and I'm trying to improve the performance of glReadPixels by using PBO to asynchronously read framebuffers.
I'm under the impression that glReadPixels after…

Ziju Feng
- 327
- 1
- 4
- 13
1
vote
0 answers
OpenGL glReadPixels gets 1282 error
I would like to create an offscreen renderer with OpenGL.
I've created a FBO and a RBO to call the glReadPixels(), but I always get an error.
This is my code:
// Init
GLuint fbo;
GLuint rbo;
glGenFramebuffers(1, &fbo);
glGenRenderbuffers(1,…

Tiberius
- 29
- 5
1
vote
0 answers
Stencil picking test always returns 0
I'm trying to implement a simple picking method in my OpenGL program.
First, I clear the stencil with
glClearStencil(0);
and at the start of my displayCallback function, I call
GLbitfield mask = GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT |…

Michal Kučera
- 223
- 1
- 11
1
vote
1 answer
OpenGL glReadPixels Performance
I am trying to implement Auto Exposure for HDR Tone mapping and I am trying to reduce the cost of finding the average brightness of my scene and I've seemed to hit a choke point with glReadPixels. Here is my setup:
1: I create a downsampled FBO to…

user3452887
- 83
- 2
- 8
1
vote
0 answers
glreadpixels filling buffer with zero
I am new to OpenGLES coding. I am using ES2.0 version. I need to read from the framebuffer, for which I am using glReadPixels. But my filled buffer is having all zeros. I am using ti omapdrm for gl display and surface creation.
My rendering thread…

THUSHARA JAYAKUMAR
- 11
- 1
1
vote
0 answers
Need help in using EGLImageKHR instead of glReadPixels
We're building a simple Android app where user can create a collage of images and video and then export it as a single video. Our current code on 16, 17 is very slow. So imagine if we have 6 videos 1 min long (each) it take us about 15min to…

Sana__Ahmed
- 11
- 3