glDrawBuffers

glDrawBuffers: man4/glDrawBuffers.xml

glDrawBuffers and glNamedFramebufferDrawBuffers define an array of buffers into which outputs from the fragment shader data will be written. If a fragment shader writes a value to one or more user defined output variables, then the value of each variable will be written into the buffer specified at a location within bufs corresponding to the location assigned to that user defined output. The draw buffer used for user defined outputs assigned to locations greater than or equal to n is implicitly set to GL_NONE and any data written to such an output is discarded. For glDrawBuffers, the framebuffer object that is bound to the GL_DRAW_FRAMEBUFFER binding will be used. For glNamedFramebufferDrawBuffers, framebuffer is the name of the framebuffer object. If framebuffer is zero, then the default framebuffer is affected. The symbolic constants contained in bufs may be any of the following: Except for GL_NONE, the preceding symbolic constants may not appear more than once in bufs. The maximum number of draw buffers supported is implementation dependent and can be queried by calling glGet with the argument GL_MAX_DRAW_BUFFERS.

The symbolic constants GL_FRONT, GL_BACK, GL_LEFT, GL_RIGHT, and GL_FRONT_AND_BACK are not allowed in the bufs array since they may refer to multiple buffers. If a fragment shader does not write to a user defined output variable, the values of the fragment colors following shader execution are undefined. For each fragment generated in this situation, a different value may be written into each of the buffers specified by bufs.

@OpenGL_Version(OGLIntroducedIn.V2P0)
fn_glDrawBuffers glDrawBuffers;

See Also

glBlendFunc, glColorMask, glDrawBuffers, glLogicOp, glReadBuffer

Meta