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

android - Can't read pixels from GraphicBuffer at adreno GPU, by Karthik's method(Hacky alternatives of glReadPixels)

Since July, I have developed Android Application to edit video files like .avi, .flv etc. I use FFMPEG and OpenGL ES 2.0 to implement this application. Because it is required too many calculations to execute a filter effect like "Blur" by CPU, I…
osehyum
  • 145
  • 1
  • 6
0
votes
1 answer

How to save large texture (efficiently) by OpenGL ES 2.0 in Android

Now, I can save texture by using glReadPixels() to read the data in framebuffer (FBO). However, I faced two problems. (1) In order to keep the saved image quality, the dimension would be larger than GL_MAX_TEXTURE_SIZE (most devices is 4096). If I…
Justin
  • 115
  • 3
  • 9
0
votes
1 answer

glReadPixels or glCopyTexSubImage2D tooo slow?

I need to draw N passes, for each pass, I read one pixel from fbo, and I find that it's too slow to read one pixel for each pass. And then, I use another texture(rectange:N*1) to cache the pixel, which means that for each pass, I copy one pixel to…
tanglei
  • 347
  • 2
  • 6
0
votes
0 answers

glCopyTexImage2D doesn't work with GL_RGBA when reading from PBuffer

I'm using NDK on Android with OpenGL ES2. I create PBuffer surface using eglCreatePbufferSurface with resolution 1024x576. I use GL_RGBA format. 8 bits for each color component. Load texture from a bitmap and blit it onto the surface. Call…
Lev
  • 730
  • 12
  • 32
0
votes
0 answers

glReadPixels with FBO crashing on iOS

I'm getting some intermittent crashing when calling glReadPixels on an FBO. Currently causing more than 1000 crashes per day in my live app. I'll include below the code for reading the pixels and generating the FBO. Happy to include other code…
OnesAndZeroes
  • 315
  • 1
  • 9
0
votes
1 answer

glReadPixels fails when hidden a element

When i touch the screen glReadpixels return the RGB of the pixel. After the touch i call a method to hidden element that has the same RGB values. After this if i touch the screen glReadpixels returns only 0 values. public void onDrawFrame(GL10 gl)…
user2390202
0
votes
1 answer

How to read OpenGL color buffer and depth buffer quickly?

I have to read color buffer and depth buffer every frame. I know the glReadPixels function is very slow, so I would like to know if there is a faster way to do the reading.
0
votes
3 answers

Finding the right context to take a screenshot with glReadPixels()

I'm trying to read directly from the frame buffer via glReadPixels() so that I can take a screenshot from whatever is on my screen. I'm not using a GUI, instead it should print the raw content of the screen whenever I touch the screen (which is…
derasd
  • 43
  • 12
0
votes
2 answers

How to stop glReadPixels converting data format by CPU?

As we know, glReadPixels() will block the pipeline and use CPU to convert data format, especially when I want to read depth value out to system RAM. I tried PBO provided by Songho, but I found it was only useful when param of glReadPixels() was set…
0
votes
1 answer

glReadPixels on separate layers

I'll get straight to the point :) From the above 480 x 320 diagram, I am thinking I can detect collision on pixel level like a worm game. What I want to know is how to sample pixels on separate layers. As you can see in the diagram, as the worm is…
Zhang
  • 11,549
  • 7
  • 57
  • 87
0
votes
1 answer

glReadPixels not working on iPhone

I'm trying to take a screenshot of a GLView on the iPhone. I wrote the following code: [self setContext]; GLint backWidth, backHeight; glGetRenderbufferParameterivOES( GL_RENDERBUFFER_OES, GL_RENDERBUFFER_WIDTH_OES, &backWidth…
Goz
  • 61,365
  • 24
  • 124
  • 204
0
votes
0 answers

OpenGL ES - glReadPixels vs TextureCached

I need to read the pixel data from the frame buffer in OpenGL ES 2.0. I know that can be done easily with glReadPixels but since iOS 5 we can use the TextureCached objects for faster reading. I have implemented the solution proposed by Brad Larson (…
0
votes
1 answer

glReadPixels() returning non-accurate value

I'm trying to implement the flood fill algorithm. But glReadPixels() is returning float RGB values of a pixel which are slightly different from the actual value set by me, causing the algorithm to fail. Why is this happening? Outputting returned RGB…
max
  • 4,248
  • 2
  • 25
  • 38
0
votes
1 answer

glreadpixel gl_depth_component returns 0?

I am looking for a solution to intersection point of a cube and a line. So i used GLES20.glReadPixels(touchX, touchY, 1, 1, GLES20.GL_DEPTH_COMPONENT, GLES20.GL_FLOAT, zz); and i showed the zz , but result was 0. so how could i get the depth…
0
votes
1 answer

how to get colors by glreadpixels?

I am trying to get a color of touch point on the screen in Android. but it shows me only RGB = (0, 0, 0) value. I have searched other sites. it said that i should add some codes below but it didn`t change…
1 2 3
13
14