Framebuffer Object
From Wikipedia, the free encyclopedia
The frame buffer object architecture (FBO) is an extension to OpenGL for doing flexible off-screen rendering, including rendering to a texture. By capturing images that would normally be drawn to the screen, it can be used to implement a large variety of image filters, and post processing effects. The FBO is analogous to the render targets model in DirectX. It is now the main choice in OpenGL because of its superior efficiency, and ease of use. It has largely superseded the pbuffer, and other methods involving OpenGL context switching, often chosen because it does not.
Contents |
[edit] Uses
The FBO has two main uses: The post-processing of rendered images and, Composition between different scenes.
Some examples are:
1. The rendered image is captured and subjected to Pixel Shaders or other computer manipulation. This allows for many of todays popular computer graphics effects to be carried out, including the addition of a blurring or bloom effect.
2. Can be used to create views of other scenes, for example: a TV in a house. A scene can be rendered through an FBO to a texture, then that texture can be applied to the surface of a TV.
[edit] Advantages over other methods
Methods involving the FBO are considered superior because:
- It is easier to setup than most other methods.
- Does not require context switching.
- Is more efficient because resources are shared within the same context.
- Is more flexible because all of depth buffer, stencil buffer, accumulation buffer, etc. can be acquired.
[edit] Architecture
To use an FBO one simply creates an instance of it. Along with the FBO comes several attachments, one can then attach these to a chosen receiver; either a texture, or a render buffer.
For example:
- Create an FBO.
- Attach the color buffer to a texture.
- Attach the depth buffer to a texture.
- Render the texture to screen with a pixel shader, dependent on both the Color infomation and depth infomation.
[edit] Links
Framebuffer object technical paper. [1]
Framebuffer object reference at openvidia.[2]