Framebuffer

Framebuffer

  • A Framebuffer is a collection of buffers that can be used as the destination for rendering.
  • OpenGL has two kinds of framebuffers: the Default Framebuffer, which is provided by the OpenGL Context; and user-created framebuffers called Framebuffer Objects (FBOs).
  • The framebuffer consists of a set of pixels arranged as a two-dimensional array.
  • Corresponding bits from each pixel in the framebuffer are grouped together into a bitplane; each bitplane contains a single bit from each pixel. These bitplanes are grouped into several logical buffers.These are the color, depth, and stencil buffers.
  • For the default framebuffer, the color buffers are the front left buffer, the front right buffer, the back left buffer, and the back right buffer.
  • Framebuffer objects are not visible, and do not have any of the color buffers present in the default framebuffer. Instead, the buffers of an framebuffer object are specified by attaching individual textures or renderbuffers to a set of attachment points.
  • In order to be used for rendering, a framebuffer object must be complete.
  • The default framebuffer is initially used as the draw and read framebuffer.

Default Framebuffer

  • The GL uses the window system-provided default framebuffer.
  • For the default framebuffer, the color buffers are the front left buffer, the front right buffer, the back left buffer, and the back right buffer.
  • Typically the contents of the front buffers are displayed on a color monitor while the contents of the back buffers are invisible.
  • The buffers for default framebuffers are part of the context and usually represent a window or display device.
  • The default framebuffer can also contain an accumulation buffer, which can be used to perform certain computations when rendering.

User-Created Framebuffer(FBOs)

  • Framebuffer objects are a collection of attachments.

  • The buffers for FBOs reference images from either Textures or Renderbuffers; they are never directly visible.

  • In particular, a framebuffer object encapsulates state necessary to describe a collection of color, depth, and stencil logical buffers.

Framebuffer-attachable images

  • For each logical buffer, a framebuffer-attachable image can be attached to the framebuffer to store the rendered output for that logical buffer.
  • Examples of framebuffer-attachable images include texture images and renderbuffer images.
  • By allowing the images of a renderbuffer to be attached to a framebuffer, the GL provides a mechanism to support off-screen rendering. Further, by allowing the images of a texture to be attached to a framebuffer, the GL provides a mechanism to support render to texture.
  • There are several types of framebuffer-attachable images
    - - The image of a renderbuffer object, which is always two-dimensional在这里插入图片描述
  • Additionally, an entire level of a three-dimensional, cube map, cube map array, or one- or two-dimensional array texture can be attached to an attachment point. Such attachments are treated as an array of two-dimensional images, arranged in layers, and the corresponding attachment point is considered to be layered.
Renderbuffer image
  • A renderbuffer is a data storage object containing a single image of a renderable internal format
  • A renderbuffer object can be attached as one of the logical buffers of a framebuffer object with the commmands
void glFramebufferRenderbuffer( enum target,
enum attachment, enum renderbuffertarget,
uint renderbuffer );
void glNamedFramebufferRenderbuffer( uint framebuffer,
enum attachment, enum renderbuffertarget,
uint renderbuffer );

attachment

在这里插入图片描述

texture image
  • To render directly into a texture image, a specified level of a texture object can be attached as one of the logical buffers of a framebuffer object with the commands.
void glFramebufferTexture( enum target, enum attachment,
uint texture, int level );
void glNamedFramebufferTexture( uint framebuffer,
enum attachment, uint texture, int level );
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值