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

WebGL Texture pixel unexpected color in PNG

I am trying to load a texture into WebGl and read a pixel color from it (to eventually use in a shader). When I read the pixel color at position 70,70 in python, I get (255,0,0,255) which is what I expected. But when I read it in WebGL, I get…
user1763510
  • 1,070
  • 1
  • 15
  • 28
0
votes
2 answers

Read Framebuffer-texture like an 1D array

I am doing some gpgpu calculations with GL and want to read my results from the framebuffer. My framebuffer-texture is logically an 1D array, but I made it 2D to have a bigger area. Now I want to read from any arbitrary pixel in the…
0
votes
1 answer

Huge delay using readRenderTargetPixels() on Chrome Android, with a second depth camera - full demo

This is obviously a call to WEBGL-Gurus out there: I'm rendering to a 2x2 pixel resolution with a second depth camera, but I'm reading only a single pixel. I have tried: renderer.readRenderTargetPixels() in Three.js (which I assume it will be the…
dllb
  • 59
  • 1
  • 7
0
votes
1 answer

Use glEGLImageTargetTexture2DOES to replace glReadPixels on Android

Given a textureId, I need to extract pixel data from the texture. glReadPixels works, but it is extremely slow on some devices, even with FBO/PBO. (On Xiaomi MI 5, it is 65 ms, and even slower with PBO). So I decided to use Hardwarebuffer and…
dnalomaz
  • 51
  • 1
  • 5
0
votes
0 answers

Opengl asyncronous PBOs read

I am developing an application that needs to read back the whole frame from the openGL frame buffer. In order to improve the performance, I'm using asynchronous glReadPixels with multiple PBOs: glBindBuffer(GL_PIXEL_PACK_BUFFER,…
iome
  • 153
  • 7
0
votes
0 answers

I am getting wrong values when calling glReadPixels

In my program I am trying to select an object on right mouse click event using glReadPixels method. Window for rendering is created using wxWidgets (by extending wxFrame and wxGLCanvas). However, I am getting wrong values. He is tutorial that I…
Elnur
  • 119
  • 1
  • 5
0
votes
1 answer

antialias=false hinder readPixels with Safari on MacOS

I use "readPixels()" for reading pixel color on webgl-canvas. I cannot read pixel when antialise set to false for getContext option. I can read with below line on Safari/MacOS, Chrome, Firefox and Safari/iOS. const gl = canvas.getContext('webgl',…
UsagiLabo
  • 63
  • 3
0
votes
1 answer

Can't glreadPixels more than 3844x1065

I am trying to render to an off-screen FBO a scene I made, and if I set width/height above 3844/1065, my final image gets limited to that resolution. I am using two monitors. The following image was rendered using 4500x2160 resolution. The "active"…
Razvan
  • 187
  • 1
  • 1
  • 8
0
votes
0 answers

nVidia GL driver states: Texture 0 is base level inconsistent

I am using glDebugMessageCallback to capture the OpenGL driver messages. When I enable all message sources and severities, my program triggers this message: Texture state usage warning: Texture 0 is base level inconsistent. Check texture size. The…
Bram
  • 7,440
  • 3
  • 52
  • 94
0
votes
1 answer

Non blocking glReadPixels of depth values with PBO

I am reading a single pixel's depth from the framebuffer to implement picking. Originally my glReadPixels() was taking a very long time (5ms or so) and on nVidia it would even burn 100% CPU during that time. On Intel it was slow as well, but with…
Bram
  • 7,440
  • 3
  • 52
  • 94
0
votes
0 answers

Reading displayed pixels on the screen

I want to read pixels from the screen/monitor after the image has been displayed to the user. MS provides Graphics.CopyFromScreen which apparently: Performs a bit-block transfer of color data from the screen to the drawing surface of the…
pookie
  • 3,796
  • 6
  • 49
  • 105
0
votes
1 answer

glReadPixels() Problem in Android to reconstruct the frame

I am working on a project on Augmented Reality with Android. The code captures the camera video, finds the marker and displays a cube on top of it. After this a motion vector (in the form of pixels moved in the x and y direction) is found. What I…
Sahiba
  • 1
  • 1
0
votes
1 answer

How can i run GLES20.glReadPixels on separate thread in android?

I am currently working with ARCore to classify images and put objects on the images. But it seems like ARCore camera doesn't provide any way to get the pixelbuffer. then i came accross How to take picture with camera using ARCore and according this…
deeppandya
  • 43
  • 1
  • 8
0
votes
2 answers

OpenGL - Pixel color at specific depth

I have rendered a 3D scene in OpenGL viewed from the gluOrtho perspective. In my application I am looking at the front face of a cube of volume 100x70x60mm (which I have as 1000x700x600 pixels). Inside this cube I have rendered a simple blue sphere…
Tim Wood
  • 67
  • 1
  • 7
0
votes
0 answers

After Android OpenGL ES 2.0 animation GLES20.glReadPixels reads the wrong value

I have this one square and when I click on it it stretches so it takes all the screen like shown in these pictures Before stretching my color picker shows the values real nice After the stretching when I click just a little below robots legs it…
etrusks
  • 363
  • 3
  • 12