[QUOTE=aqnuep;1248283]The drawbuffer parameter must be the drawbuffer index, i.e. an index into the array of draw buffers specified through glDrawBuffers.
E.g.:
GLenum drawbuffers[] = { GL_COLOR_ATTACHMENT3, GL_COLOR_ATTACHMENT1 };
glDrawBuffers(2, drawbuffers);
glClearBuffer*(GL_COLOR, 0, color); // clears GL_DRAW_BUFFER0, i.e. GL_COLOR_ATTACHMENT3
glClearBuffer*(GL_COLOR, 1, color); // clears GL_DRAW_BUFFER1, i.e. GL_COLOR_ATTACHMENT1
It works the exact same way with the default FBO, just the draw buffer enums are different there.
E.g.
GLenum drawbuffers[] = { GL_FRONT, GL_BACK };
glDrawBuffers(2, drawbuffers);
glClearBuffer*(GL_COLOR, 0, color); // clears GL_DRAW_BUFFER0, i.e. GL_FRONT
glClearBuffer*(GL_COLOR, 1, color); // clears GL_DRAW_BUFFER1, i.e. GL_BACK
You probably forgot to call glDrawBuffers.[/QUOTE]
Thanks for your reply.
I did this:
GLenum buffers[] = { GL_COLOR_ATTACHMENT0};
glDrawBuffers(1,buffers);
GLint cl[]={32000,32000,32000,32767};
glClearBufferiv(GL_COLOR, 0, cl);
I am binding non default fbo and then while rendering on it i put above calls. My non default FBO has color (GL_COLOR_ATTACHMENT0) and depth attachment.
I dont understand what is wrong with above code… Is it a driver bug?