Login  Register

Why does the RGB value always equal to (0, 0, 0) when I use gl2.glReadPixels(e.x, viewport[3] - e.y, 1, 1, GL2.GL_RGB, GL2.GL_FLOAT, FloatBuffer.wrap(color));

classic Classic list List threaded Threaded
2 messages Options Options
Embed post
Permalink
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Why does the RGB value always equal to (0, 0, 0) when I use gl2.glReadPixels(e.x, viewport[3] - e.y, 1, 1, GL2.GL_RGB, GL2.GL_FLOAT, FloatBuffer.wrap(color));

Irene Tang
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Why does the RGB value always equal to (0, 0, 0) when I use gl2.glReadPixels(e.x, viewport[3] - e.y, 1, 1, GL2.GL_RGB, GL2.GL_FLOAT, FloatBuffer.wrap(color));

elect
Because it means at that moment when you read that pixel that is its value.

You should read this to understand problems of deprecated (fixed function) opengl and benefits of the current one