GLDRAWBUFFERS(3G)
β¨ NAME β¨
glDrawBuffers, glNamedFramebufferDrawBuffers β specifies the list of color buffers that fragment colors get drawn into. periodt π
Bestie, welcome to the glDrawBuffers / glNamedFramebufferDrawBuffers page, manual-name energy, 3G edition. The header is lowkey giving [FIXME: manual] placeholder realness, and we move.
π C SPECIFICATION π
void glDrawBuffers(GLsizei n, const GLenum *bufs);
void glNamedFramebufferDrawBuffers(GLuint framebuffer, GLsizei n,
const GLenum *bufs);
πΈ PARAMETERS πΈ
framebufferβ the name of the framebuffer object forglNamedFramebufferDrawBuffers. iconic little handle.nβ the number of buffers inbufs. yes, the count, not the vibe.bufsβ points to an array of symbolic constants specifying the buffers into which fragment colors or data values will be written.
π¦ DESCRIPTION π¦
So 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. gone, reduced to atoms π
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:
GL_NONEβ the fragment shader output value is not written into any color buffer. nothing. silence. self-care.GL_FRONT_LEFTβ the fragment shader output value is written into the front left color buffer.GL_FRONT_RIGHTβ the fragment shader output value is written into the front right color buffer.GL_BACK_LEFTβ the fragment shader output value is written into the back left color buffer.GL_BACK_RIGHTβ the fragment shader output value is written into the back right color buffer.GL_COLOR_ATTACHMENTnβ the fragment shader output value is written into the nth color attachment of the current framebuffer.nmay range from zero to the value ofGL_MAX_COLOR_ATTACHMENTS.
Except for GL_NONE, the preceding symbolic constants may not appear more than once in bufs. no duplicates, babe, weβre not doing that today π
The maximum number of draw buffers supported is implementation dependent and can be queried by calling glGet() with the argument GL_MAX_DRAW_BUFFERS.
π NOTES π
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. itβs giving βtoo many vibes at once,β and the API said no β
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. spooky. no cap.
π₯ ERRORS π₯
GL_INVALID_OPERATIONerror is generated byglNamedFramebufferDrawBuffersifframebufferis not zero or the name of an existing framebuffer object.GL_INVALID_ENUMis generated if one of the values inbufsis not an accepted value.GL_INVALID_ENUMis generated if the API call refers to the default framebuffer and one or more of the values inbufsis one of theGL_COLOR_ATTACHMENTntokens.GL_INVALID_ENUMis generated if the API call refers to a framebuffer object and one or more of the values inbufsis anything other thanGL_NONEor one of theGL_COLOR_ATTACHMENTntokens.GL_INVALID_ENUMis generated ifnis less than0.GL_INVALID_OPERATIONis generated if a symbolic constant other thanGL_NONEappears more than once inbufs.GL_INVALID_OPERATIONis generated if any of the entries inbufs(other thanGL_NONE) indicates a color buffer that does not exist in the current GL context.GL_INVALID_OPERATIONis generated if any value inbufsisGL_BACK, andnis not one.GL_INVALID_VALUEis generated ifnis greater thanGL_MAX_DRAW_BUFFERS.
β ASSOCIATED GETS β
glGet()with argumentGL_MAX_DRAW_BUFFERSglGet()with argumentGL_DRAW_BUFFERiwhereiindicates the number of the draw buffer whose value is to be queried.
π VERSION SUPPORT π
The version-support tea, with the tableβs βFunction / Feature Nameβ column and βOpenGL Versionβ columns translated into group-chat bullet form:
glDrawBuffersβ supported in OpenGL2.0,2.1,3.0,3.1,3.2,3.3,4.0,4.1,4.2,4.3,4.4, and4.5. all checkmarksβ, all slay β¨glNamedFramebufferDrawBuffersβ2.0,2.1,3.0,3.1,3.2,3.3,4.0,4.1,4.2,4.3, and4.4are all-; only4.5has aβ. late bloomer icon behavior π
π«Ά SEE ALSO π«Ά
glBlendFunc(), glColorMask(), glDrawBuffers(), glLogicOp(), glReadBuffer()
π COPYRIGHT π
Copyright Β© 2003-2005 3Dlabs Inc. Ltd. Copyright Β© 2010-2014 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/.
π COPYRIGHT (yes, again, bestie) π
Copyright Β© 2003-2005 3Dlabs Inc. Ltd. Copyright Β© 2010-2014 Khronos Group
kisses and sparkles, this pageβs source/version is [FIXME: source], dated 08/09/2021 β and thatβs the whole manual-page meal, mwah ππ
π¦ where this page comes from
- centos-stream 9: gl-manpages 1.1-24.20190306.el9 Β· MIT and Open Publication
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms