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
0
votes
2 answers

glReadPixels with screen pixels

I am trying to read the RGB value of a screen pixel doing: #include "stdafx.h" #include #include #include int main(int argc, char** argv) { GLubyte color[3]; glReadPixels(800, 800, 1, 1, GL_RGB,…
sergio
  • 183
  • 1
  • 2
  • 11
0
votes
1 answer

Android OpenGLES get cloor data from textureID

I have a problem about Android get color data from textureID I hope use openGLES to got real pixels data and modify it This is my code and in the Gallerydata. All of bytes are zero, but glgetError is 0. I don't know why. Is Any genius man can help…
J.S Lee
  • 29
  • 2
  • 9
0
votes
1 answer

Android: Incomplete image with glReadPixels on Adreno 530 GPU

Has anyone experienced something similar or can point to the where the issue might be in the code below? For some reason transparent "dots" appear in the screenshot. It's not all frames maybe every second. I'm seeing some weird behaviour with the…
0
votes
1 answer

How to get 24bit color information by glReadPixels() on android?

To save processed image by OpenGL ES, I made codes as follows. And it works well. ByteBuffer bb = ByteBuffer.allocate(mWidth * mHeight * 4); mGL.glReadPixels(0, 0, mWidth, mHeight, GL_RGBA, GL_UNSIGNED_BYTE, bb); try { TJCompressor tjCompressor…
user6760779
0
votes
1 answer

Iphone glReadPixels problem

I am drawing a PIE char in Iphone, with OPENGL ES. Now I need to check the color of the pie where user clicked. When I click any pie, it sometimes returns correct values, and sometimes not correct, and sometimes just returning 0,0,0. '(void)…
Oleg Danu
  • 4,149
  • 4
  • 29
  • 47
0
votes
0 answers

glReadPixels() fails, but replacing GL_RGBA with GL_RGB makes it work, inside pyglet

On Ubuntu 14.04, I'm testing an open source project which uses pyglet. I'm running /usr/bin/Xorg directly and separately, using the Nvidia driver with a Nvidia GPU. The project has this part: buffer =…
noname
  • 343
  • 4
  • 14
0
votes
1 answer

LibGDX/OpenGL - glReadPixels Transparency Issue

I have a problem with glReadPixels/ScreenUtils.getFrameBufferPixmap() where semi-transparent sprites drawn on top of opaque ones seem to "overwrite" the transparency, resulting in a mess. Black sprites with 10% transparency are drawn on top of the…
Anuken
  • 65
  • 11
0
votes
2 answers

glReadPixels crashes on specific render buffer widths

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…
Vladimir
  • 94
  • 6
0
votes
5 answers

Get Data from OpenGL glReadPixels(using Pyglet)

I'm using Pyglet(and OpenGL) in Python on an application, I'm trying to use glReadPixels to get the RGBA values for a set of pixels. It's my understanding that OpenGL returns the data as packed integers, since that's how they are stored on the…
Alex Gaynor
  • 14,353
  • 9
  • 63
  • 113
0
votes
1 answer

Android Opengl ES 3.0 Pixel Buffer Object And glReadPixel

I want to improve glReadPixels() performance using PBO(for Android 4.3+), As glReadPixels takes about 30~50ms(1280*960) for each frame in my test device.But I can't use glReadPixels directly in Java, since the last param cannot be zero or "null". I…
yu yang
  • 1
  • 2
0
votes
0 answers

I suspect glReadPixel doesn't return the right depth value. Why?

In my program I've loaded a mesh model on my canvas and initially read its depth values with glReadPixels. This code is written after gl.glFlush() in the display function: FloatBuffer depth_mann =…
Sunny Hill
  • 21
  • 4
0
votes
1 answer

glReadPixels returns incorrect image for iPhone 6, but works ok for iPad and iPhone 5

I'm using following code for reading on image from OpenGL ES scene: - (UIImage *)drawableToCGImage { CGRect myRect = self.bounds; NSInteger myDataLength = myRect.size.width * myRect.size.height * 4; glFinish(); glPixelStorei(GL_PACK_ALIGNMENT,…
Sashucity
  • 21
  • 4
0
votes
1 answer

glResolveMultisampleFramebufferAPPLE() generate GL_INVALID_OPERATION on iOS (OpenGL ES 2.0)

I want to use function glReadPixels() to do screenshot of my scene. And it works great if I don't use multisampling. But if I do I get GL_INVALID_OPERATION in glResolveMultisampleFramebufferAPPLE(). Is there a way to resolve this problem? My save…
vkalit
  • 647
  • 8
  • 19
0
votes
1 answer

WebGL: INVALID_OPERATION: readPixels: ArrayBufferView not large enough for dimensions

Basically I have 200 X 200 px canvas, a voxel which is 20 X 20 X 20 px. So I have 100 voxels. When I draw on canvas, I want to see which pixel is drawn and if that pixel is inside one of the voxel then I will display that voxel. Below…
spuemaacne
  • 219
  • 2
  • 4
  • 15
0
votes
1 answer

egl pbuffer offscreen rendering can only read back background

I want to achieve egl offscreen rendering with pbuffer surface. but all I can read back is the background color. things I draw can't be seen. for example, if I clear the screen with blue, the read back image via glReadPixel is just a blue-colored…
Bill Yan
  • 3,369
  • 4
  • 27
  • 42