PBO FBO TBO?

Started by
10 comments, last by MARS_999 14 years, 8 months ago
can someone explain to me what is the difference between Pixel Buffer Object : http://www.opengl.org/registry/specs/ARB/pixel_buffer_object.txt Frame Buffer Object : http://www.opengl.org/registry/specs/EXT/framebuffer_object.txt Texture Buffer Object : http://www.opengl.org/registry/specs/EXT/texture_buffer_object.txt where's the best situation (and case example) to use each buffer?
Advertisement
PBOs are used for async data upload. You can store pixel data in a buffer (which is mostly stored in video memory) and later use it for commands that read/write pixel data, such as glReadPixels, glTexImage1D/2D/3D, etc.

FBOs are used for offscreen rendering and multiple render targets. You can draw to a texture or an renderbuffer. You can later read that texture in a shader to do things like postprocessing.

TBOs just allow to read a buffer object as a texture in a shader. The backing store of the texture is the buffer object data, so it's pretty generic on what it can be done with it.
Quote:Original post by HuntsMan
PBOs are used for async data upload. You can store pixel data in a buffer (which is mostly stored in video memory) and later use it for commands that read/write pixel data, such as glReadPixels, glTexImage1D/2D/3D, etc.

so it is used for writing pixel data to a texture, and later on the texture could be used by shader.

Quote:FBOs are used for offscreen rendering and multiple render targets. You can draw to a texture or an renderbuffer. You can later read that texture in a shader to do things like postprocessing.

so it is mostly used for rendering to texture, ok i got it.

Quote:TBOs just allow to read a buffer object as a texture in a shader. The backing store of the texture is the buffer object data, so it's pretty generic on what it can be done with it.

in this case the difference between TBO and PBO is, TBO make it possible that any data could be treated as a texture on shader (such as vertex position, vertex normal, indices, vertex attribs anything that stored on a buffer object), and PBO is a more specific buffer that only hold pixel data.

because its a specific buffer for pixel data, then one of its important feature is we could use opengl pixel manipulation function on it.

am I right?



Yes. TBO's can only be read by shaders, but PBOs can be used by other GL functions.
Quote:Original post by HuntsMan
Yes. TBO's can only be read by shaders, but PBOs can be used by other GL functions.


we still could use MapBuffer function to read and write to TBO isn't it?
Yes, all buffers can be read with glMapBuffer.
if I want to build a GUI system, which is using Cairo to render it, which one is best using PBO or TBO since i don't need GL pixel manipulation, no mipmaping and no texture filtering just RGBA buffer. performance-wise?
I think you don't need any of them. You can just render to the backbuffer.
This says it can do GL rendering
http://en.wikipedia.org/wiki/Cairo_(graphics)
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);
Quote:Original post by V-man
I think you don't need any of them. You can just render to the backbuffer.
This says it can do GL rendering
http://en.wikipedia.org/wiki/Cairo_(graphics)


if I render to backbuffer i won't have flexibility for compositing floating/cascading window or widget, transparency, animation etc (like Compiz). and every pixel on the screen should be redraw each frame, unlike using quad texture for each surface of Cairo i can only draw which surface has changed.
Quote:Original post by rvx
Quote:Original post by V-man
I think you don't need any of them. You can just render to the backbuffer.
This says it can do GL rendering
http://en.wikipedia.org/wiki/Cairo_(graphics)


if I render to backbuffer i won't have flexibility for compositing floating/cascading window or widget, transparency, animation etc (like Compiz). and every pixel on the screen should be redraw each frame, unlike using quad texture for each surface of Cairo i can only draw which surface has changed.


I don't know what you mean by compositing floating/cascading window but I have done a GUI system that draws windows and other controls and it renders to the backbuffer. I just need to do a code review some day.

Perhaps you should use FBO if you don't intend to update some of those windows. This is called RTT = render to texture
http://www.opengl.org/wiki/OpenGL_extensions#Framebuffer_related_extensions
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

This topic is closed to new replies.

Advertisement