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));
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));
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));
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