

However, at other times, it is entirely reasonable for a shader to want to write sRGB values directly, and therefore want to store the written provided without any conversion. But if we are writing to an sRGB image, it is entirely reasonable for a shader to want to write linear values which will be automatically converted to sRGB for storage.


When the output buffer is linear RGB, the answer is assumed to be linear. However, when writing values from a Fragment Shader to the image, a question arises: in what colorspace are the values written by the shader? Normally, sRGB images perform color correction, such that texture reads from them will always convert them to linear RGB. Note that most other uses of GL_FRAMEBUFFER mean the draw framebuffer this is the case when it means both.Ĭolor Image Formats can be in a linear or sRGB colorspace. The read framebuffer is used as the source for reading operations.īinding to the GL_FRAMEBUFFER target is equivalent to binding that framebuffer to both GL_DRAW_FRAMEBUFFER and GL_READ_FRAMEBUFFER. The draw framebuffer is used as the destination for rendering, clearing, and other writing operations. They can be bound to one of two targets: GL_DRAW_FRAMEBUFFER and GL_READ_FRAMEBUFFER. GlBindFramebuffer is used to bind framebuffers to the context. The default framebuffer's buffer names are separate from framebuffer object buffer names. For example the GL_BACK_RIGHT buffer will only have an image if the default framebuffer is double-buffered and uses stereoscopic 3D.

Buffers in FBOs are also called "attachment points" they're the locations where images can be attached.ĭefault framebuffers cannot change their buffer attachments, but a particular default framebuffer may not have images associated with certain buffers. An image may or may not be associated with a particular buffer in a framebuffer. Note that the term "buffer" here refers to a specific location in the framebuffer. The buffers for FBOs reference images from either Textures or Renderbuffers they are never directly visible. The buffers for default framebuffers are part of the context and usually represent a window or display device. OpenGL has two kinds of framebuffers: the Default Framebuffer, which is provided by the OpenGL Context and user-created framebuffers called Framebuffer Objects (FBOs). A Framebuffer is a collection of buffers that can be used as the destination for rendering.
