Reputation: 1769
Can someone point out to me if both of them are the same? I mean I have been reading info about it and this redbook here says
"The color buffer itself can consist of several subbuffers. The framebuffer on a system comprises all of these buffers" here
Is framebuffer then like a virtual buffer consisting of all the actual buffers?(like depth/stencil etc)
Upvotes: 4
Views: 10093
Reputation: 2413
If you really want to grok this, have a look at OpenGL Framebuffer Objects. FBOs are "offscreen" rendering targets. All this means is that instead of making your picture appear on your display, you render it to some other place -- an FBO. Before you can do this, you have to create and configure the FBO. Part of that configuration is adding a color attachment -- a buffer to hold the per-pixel color information of the rendered picture. Maybe you stop there, or maybe you also add a depth attachment. If you are rendering 3D geometry, and you want it to look correct, you'll likely have to add this depth attachment.
In fact, it's a good experiment. Write a small OpenGL program that renders a simple 3D cube to the screen. Once you have that working, change your rendering destination to an FBO that you configure with only a color attachment. Likely, it won't look quite right, since OpenGL has no place to store the depth information during rendering. Boom! Everything gets the same depth. Now add a depth attachment to your FBO and see how the rendering changes.
Once you consider that the screen framebuffer is basically a default, setup-from-the-start FBO, it's pretty clear that a framebuffer consists of multiple buffers.
Upvotes: 6
Reputation: 213358
The framebuffer contains (often) the depth, stencil, color, and accumulation buffers. The color buffers are the most important part, but they are only one part. You can create more color buffers, and you can also create more framebuffers in OpenGL.
When you say "virtual framebuffer" that sometimes means a framebuffer which is not drawn to the screen (e.g., it is written to disk, or used as a texture). I believe this terminology is specific to X11, not OpenGL.
Upvotes: 8