FBO and RBO and how they are used

Started by
2 comments, last by Ashaira 12 years ago
I need to add frame buffer objects and render buffer objects to my engine but i am having trouble understanding how they work. Ive done some image processing at university which was basically applying algorithms on the image loaded. I thought at first that FBO basically meant rendering to it first applying said post processing algorithm then send the result to the screen.

I think i am missunderstanding how post processing effects work. i looked at a few FBO tutorials and basically only the textures are sent to it not the actual "screen" as an image. Does that mean that the effects are applied to the textures and then the textures are sent to the objects from the FBO? and what are the render buffer objects for then if the texture is sent to the FBO?
Advertisement
Frame Buffer Object really represents just a view of a texture (or a part of a texture). A texture is an array of texels. Not only in DirectX it is called "Render Target" and it really is the same concept. All rendering always DOES go into "textures". Forget about the concept of a "screen", think the way the card thinks: "Give me some rectangular target array and I'll happily apply a pixel shader to each of its fragments". Your application can then present this texture to the user ("send it to screen", which usually DOES involve copying it via "CPU" into a widget or window canvas or whatever, automatically (swap-chain) or manually), or do some more processing, or store it to disk, or whatever.

The OpenGL terminology actually is way more complicated than what I've just presented, study it thoroughly here:

http://www.opengl.or...mebuffer_Object
http://www.songho.ca...ngl/gl_fbo.html

A short answer to the difference between GL FBO and RBO:

There is one active FBO that is the target of all rendering output and it might "contain" several target textures - a colour, another colour texture, maybe yet another texture to store anything auxiliary, a depth (all these are called FB attachments)... You can attach basically "any" number of any textures or RBOs to a FBO at once.

A RBO is a single texture and is one of attachments to a FBO. A RBO content can be modified exclusively by rendering to it while attached to a FBO (possibly with other RBOs or textures or not). RBO content can then be copied to another texture (so called "unpacking"). RBO doesn't have mip-maps. RBO cannot be pre-initialised with any pixel data. I'd use a RBO as a depth buffer (Z-buffer).

An ordinary OpenGL texture can have mip-maps and any of its mip-slices can indeed serve the very same purpose as a RBO, that is serve as a render target.

Also, ordinary textures can serve as "sources" of data in your shaders (actual surface-modifying colour data, normals or anything at all). RBOs are "destination-only". And FBOs, again, encapsulate various textures and/or RBOs and as such don't posses any own data.

Complicated, huh? biggrin.png

Frame Buffer Object really represents just a view of a texture (or a part of a texture). A texture is an array of texels. Not only in DirectX it is called "Render Target" and it really is the same concept. All rendering always DOES go into "textures". Forget about the concept of a "screen", think the way the card thinks: "Give me some rectangular target array and I'll happily apply a pixel shader to each of its fragments". Your application can then present this texture to the user ("send it to screen", which usually DOES involve copying it via "CPU" into a widget or window canvas or whatever, automatically (swap-chain) or manually), or do some more processing, or store it to disk, or whatever.

The OpenGL terminology actually is way more complicated than what I've just presented, study it thoroughly here:

http://www.opengl.or...mebuffer_Object
http://www.songho.ca...ngl/gl_fbo.html

A short answer to the difference between GL FBO and RBO:

There is one active FBO that is the target of all rendering output and it might "contain" several target textures - a colour, another colour texture, maybe yet another texture to store anything auxiliary, a depth (all these are called FB attachments)... You can attach basically "any" number of any textures or RBOs to a FBO at once.

A RBO is a single texture and is one of attachments to a FBO. A RBO content can be modified exclusively by rendering to it while attached to a FBO (possibly with other RBOs or textures or not). RBO content can then be copied to another texture (so called "unpacking"). RBO doesn't have mip-maps. RBO cannot be pre-initialised with any pixel data. I'd use a RBO as a depth buffer (Z-buffer).

An ordinary OpenGL texture can have mip-maps and any of its mip-slices can indeed serve the very same purpose as a RBO, that is serve as a render target.

Also, ordinary textures can serve as "sources" of data in your shaders (actual surface-modifying colour data, normals or anything at all). RBOs are "destination-only". And FBOs, again, encapsulate various textures and/or RBOs and as such don't posses any own data.

Complicated, huh? biggrin.png


im starting to get the "picture" now if u know what i mean :D but one more question. most of the examples i find are in linear programing so my question is should i make an FBO for each texture the same way you make a VBO for each model or make one for all the textures?(which thinking about it makes no sense but just to be sure)
EDIT: NVM i figured it out during the weekend.

This topic is closed to new replies.

Advertisement