Framebuffer object: Difference between revisions

Content deleted Content added
Created main bulk of article.
Rescuing 1 sources and tagging 0 as dead.) #IABot (v2.0.9.2
 
(38 intermediate revisions by 32 users not shown)
Line 1:
The '''frame buffer object''' architecture (FBO) is an extension to [[OpenGL]] for doing ''flexible off-screen rendering'', including rendering ''to a [[texture'' (computer graphics)|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 used in OpenGL for its efficiency and ease of use. The use of FBOs doesn't suffer from the overhead associated with OpenGL drawing context switching, and has largely superseded the [[pbuffer]] and other methods involving context switches.
{{ redirect |FBO}}
 
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 it's ''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.
 
==Uses==
 
The FBO has two main uses: The post-processing of rendered images and, Composition between different scenes.
 
== Uses ==
The FBO has two main uses: The post-processing of rendered images and, Compositioncomposition between different scenes.
Some examples are:
# The rendered image is captured and subjected to [[Fragment Shaders]] or other manipulations. This allows for many of todays 'today's 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 showing the view from a secondary camera. A scene can be rendered through an FBO to a texture, then that texture can be applied to the surface of a TV. This is sometimes called "Render to Texture" or RTT.
 
== Advantages over other methods ==
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.
 
==Advantages over other methods==
 
Methods involving the FBO are considered superior because:
* It is easier to setupset up than most other methods.
 
* It is easier to setup than most other methods.
* Does not require context switching.
* Is more efficient duebecause resources beingare shared within the same context.
* Is more flexible because all of [[depth buffer]], [[stencil buffer, accumulation buffer]], etc. can be acquired.
 
==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 the 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
 
== Architecture ==
=Links=
To use an FBO one simply creates an instance of it. Along with the FBO comescome several attachments,. oneOne can then attach these to a chosen receiver: either a [[Texture (computer graphics)|texture]], or a [[render buffer]].
 
forFor example:
Framebuffer object techinal paper. [http://oss.sgi.com/projects/ogl-sample/registry/EXT/framebuffer_object.txt]
* Create an FBO and bind it.
* attachAttach the color buffer to(either theas a RenderBuffer or a texture) to the FBO.
* Attach the depth buffer (either as a RenderBuffer or a texture) to the FBO.
* Bind the native window FrameBuffer (id=0)
* renderRender the texture to screen with a pixel shader, dependent on both the Color infomationinformation and depth infomationinformation.
 
== External links ==
Framebuffer object reference at openvidia.[http://openvidia.sourceforge.net/fbo.shtml]
* [http://oss.sgi.com/projects/ogl-sample/registry/EXT/framebuffer_object.txt Framebuffer object technical paper] {{Webarchive|url=https://web.archive.org/web/20130502110335/http://oss.sgi.com/projects/ogl-sample/registry/EXT/framebuffer_object.txt |date=2013-05-02 }}
* [https://web.archive.org/web/20070108122530/http://openvidia.sourceforge.net/fbo.shtml Framebuffer object reference at openvidia]
* [http://www.songho.ca/opengl/gl_fbo.html Example code for Windows and Linux]
* [https://web.archive.org/web/20131101002803/http://www.opengl.org/wiki/GL_EXT_framebuffer_object EXT Framebuffer] (opengl.org)
 
[[Category:OpenGL]]
{{compu-prog-stub}}