I have checked this similar question, but the suggestions did not solve my problem: Low precision and clamping when writing to floating point FBO.
I
Do a full set of glClampColor()
operations in your initGL()
function:
glClampColor(GL_CLAMP_READ_COLOR, GL_FALSE);
glClampColor(GL_CLAMP_VERTEX_COLOR, GL_FALSE);
glClampColor(GL_CLAMP_FRAGMENT_COLOR, GL_FALSE);
On my system I only needed the GL_CLAMP_VERTEX_COLOR
.
You must use glClampColor to state whether the colors you read with glReadPixels
will be clamped or not.
Note that this is just for the reading of the color. What gets written by the fragment shader will always be unclamped.