Hi,I need to render the scene to frame buffer object, in the first step I just render the meshes to FBOs. In the next step I need to render all the FBOs to one FBO.
I did it like this:
1)active the shader.
2)bind all the fbo to the shader
3)DrawQuad
4)unbind and deactive the shader.
when DrawQuad is:
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glEnable(GL_TEXTURE_2D);
glColor3f(1.0f, 1.0f, 1.0f);
glBegin(GL_QUADS);
glTexCoord2f(0.0f, 0.0f);glVertex2f(-1.0f, -1.0f);
glTexCoord2f(1.0f, 0.0f);glVertex2f(1.0f, -1.0f);
glTexCoord2f(1.0f, 1.0f);glVertex2f(1.0f, 1.0f);
glTexCoord2f(0.0f, 1.0f);glVertex2f(-1.0f, 1.0f);
glEnd();
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
and the program render the scene to the screen, and not to the FBO.
I think its becouse of “glBegin(GL_QUADS);”.
there are another way to render some FBO to one FBO?
thanks.