In order to implement object picking, I have set up an FBO with one color and one depth renderbuffer.
Now my questions are:
How should I read from and write to the color renderbuffer (although the latter is not required for picking… just wondering)? Do I need to make any API calls besides glReadPixels and glDrawPixels (like setting glReadBuffer and glDrawBuffer, etc.)? Please be as specific as you can.
Besides, in case the FBO is not active anymore (the backbuffer is set as the active framebuffer for instance), should I re-bind the FBO every time I need to read from these renderbuffers? Can’t I just rebind the renderbuffer itself (via glBindRenderbuffer( GL_RENDERBUFFER, 0 )) and be done with it?