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
Reply | Threaded
Open this post in threaded view
|

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
|

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