From what I understand:
- glDrawBuffer selects a single draw color buffer attachment in an FBO, or up to four color buffers in the default framebuffer (using aliases); in the latter case the fragment shader will write the same fragment to each color buffer
- glDrawBuffers creates a table of color buffers whose indexes correspond to fragment shader output locations
Is this state stored independently?
What happens with fragment shader with more than one output location in the case where glDrawBuffer was called? Does only the 0 location get written into the specified color buffers?
Edit: Also I have similar confusion for the result of glClear(GL_COLOR_BUFFER_BIT)-- this will clear all the color buffers? only those specified by glDrawBuffer and/or glDrawBuffers?