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
4
votes
1 answer

Qt / C++ - Converting raw binary data and display it as an image (i.e. QImage)

I have a C++ Open GL application that renders an animation display, and captures the frame-buffer contents using glReadPixels(), which is then stored as a 1D char array. I can get the buffer contents and save it to a char array, as follow: char *…
all_by_grace
  • 2,315
  • 6
  • 37
  • 52
4
votes
5 answers

Converting RGBA to ARGB (glReadPixels -> AVAssetWriter)

I want to record images, rendered with OpenGL, into a movie-file with the help of AVAssetWriter. The problem arises, that the only way to access pixels from an OpenGL framebuffer is by using glReadPixels, which only supports the RGBA-pixel format on…
Dominik Seibold
  • 2,439
  • 1
  • 23
  • 29
4
votes
1 answer

Reading data using glReadPixel() with multisampling

Presently I am trying to read the pixel data from the frame Buffer in order to capture the screen in IOS. GlreadPixels command works fine when using the following code to setup frame buffer :- //buffers // Create a depth buffer that has the same…
Tornado
  • 1,069
  • 12
  • 28
4
votes
1 answer

OpenGLScreenSnapshot doesn't work in Mac OS X 10.7 - Lion

I've been writing a program based on the ScreenSnapshot example from apple: http://developer.apple.com/library/mac/#samplecode/OpenGLScreenSnapshot/Introduction/Intro.html and after upgrading from Snow Leopard to Lion my program stopped working.…
Ilya
  • 342
  • 2
  • 10
4
votes
3 answers

glReadPixels() slow on reading GL_DEPTH_COMPONENT

My application is dependent on reading depth information back from the framebuffer. I've implemented this with glReadPixels(0, 0, width, height, GL_DEPTH_COMPONENT, GL_FLOAT, &depth_data) However this runs unreasonable slow, it brings my application…
Paul Wagener
  • 432
  • 6
  • 12
4
votes
0 answers

Using glReadPixels with PBO does not improve performance (GLES3)

I'm trying to implement the PBO logic with glReadPixels (on an Android app), in order to read the data asynchronously. The motivation for this is that the app renders a video on screen, and I want to take screenshots of that video, without delaying…
AnatH
  • 76
  • 5
4
votes
1 answer

Android OpenGL ES 3.0 PBO instead of glReadPixels()

I want to improve glReadPixels() performance using PBO (for GLES 3 devices) and I ran into a problem in this piece of code: final ByteBuffer pboByteBuffer = ByteBuffer.allocateDirect(4 * mWidth *…
Sam
  • 1,652
  • 17
  • 25
4
votes
2 answers

glReadPixels gives a black image only on iOS 7 device

In an OpenGL ES app I'm working on, I noticed that the glReadPixels() function fails to work across all devices/simulators. To test this, I created a bare-bones sample OpenGL app. I set the background color on an EAGLContext context and tried to…
Sagar Patel
  • 187
  • 1
  • 10
4
votes
1 answer

glreadpixels stencil buffer always throws GL_INVALID_OPERATION

I'm trying to figure out stencils. Right now I am just drawing some boxes with stencil values, then reading the value. Every time I call glReadPixels with GL_STENCIL_INDEX, I get GL_INVALID_OPERATION. Here is the code in…
tmo7452
  • 43
  • 4
4
votes
1 answer

Performance boost for glReadPixels in Android by OpenGL ES 3.0

I found some ways to speed up glReadPixels by OpenGL ES 3.0, but I am not sure if it works or not. specifies the fifth argument of glReadPixels() as GL_BGRA to avoid unnecessary swizzle. use PBO as this mentioned. In order to verify, I updated to…
Justin
  • 115
  • 3
  • 9
4
votes
2 answers

glReadPixel stopped working with iOS6 Beta

Possible Duplicate: Why is glReadPixels() failing in this code in iOS 6.0? I currently have an App in Appstore that uses the Cocos2D framework. For collision detection I am using glReadPixels. The screen only has white and black pixels and…
Michael
  • 176
  • 1
  • 8
4
votes
1 answer

OpenGL ES to video in iOS (rendering to a texture with iOS 5 texture cache)

You know the sample code of Apple with the CameraRipple effect? Well I'm trying to record the camera output in a file after openGL has done all the cool effect of water. I've done it with glReadPixels, where I read all the pixels in a void * buffer…
user1562826
  • 69
  • 1
  • 3
4
votes
2 answers

When glReadPixels can be used?

I want to know the use of GLReadPixels function./ How it is reading the pixels? Is it reading GLKView pixels or UIView pixels or anything on the mainscreen which is in bounds provided in the glreadFunction. Or it can only be used if we are using…
Karan Sehgal
  • 91
  • 1
  • 5
3
votes
3 answers

glReadPixels only saves 1/4 screen size snapshots

I'm working on an Augmented Reality app for a client. The OpenGL and EAGL part has been done in Unity 3D, and implemented into a View in my application. What i need now, is a button that snaps a screenshot of the OpenGL content, which is the…
Thomas
  • 53
  • 1
  • 7
3
votes
1 answer

glReadPixels with FBO is too slow

I am using openGL ES 2.0 and GLSL shader and working on FBO with Renderbuffer, aka offscreen rendering. It works fine with 30 fps. But when I use glReadPixels or glcopyteximage2d, it drops to 8 fps. I did something…
user2168
  • 309
  • 8
  • 15
1
2
3
13 14