glClear clamping colors to FBO

Started by
1 comment, last by InetRoadkill 15 years, 12 months ago
Is there a way to stop glClear() from clamping the color values written to an FBO? I've tried to use: glClampColorARB(GL_CLAMP_VERTEX_COLOR_ARB, GL_FALSE); glClampColorARB(GL_CLAMP_READ_COLOR_ARB, GL_FALSE); glClampColorARB(GL_CLAMP_FRAGMENT_COLOR_ARB, GL_FALSE); glClearColor(1000.0f, 0, 0, 0); glClear(GL_COLOR_BUFFER_BIT); But the values read back from the FBO show that they still being clamped. The FBO is set to GL_RGB32F_ARB which works fine when using cg fragment programs. It seems opengl is messing with me. glColor3f() also appears to be doing the same thing in this respect.
Advertisement
Works fine for me and I don't need to call any of those glClampColorARB.
Are you reading your FBO like this?
glReadPixels(0, 0, 1, 1, GL_BGRA, GL_FLOAT, pixels);

because I get {0, 0, 1000.0, 0}
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);
I'm actually using:

glReadPixels(0, 0, 1, 1, GL_RGB, GL_FLOAT, pixels);

I suspect it's a driver issue. I have a cg program as a work-around for now.

This topic is closed to new replies.

Advertisement