Jump to content
  • Advertisement
Sign in to follow this  
WizardOfOzzz

OpenGL FBO Render buffer vs Texture. When to use each?

This topic is 4016 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi All, I noticed OpenGL has this idea of render buffers as well as textures, but you can to both using FBOs.. So I'm just wondering if I can get a good explaination on when to use a buffer and when to use a texture. For example, if I want to have a depth buffer to use in an FBO, I can create a depth/stencil render buffer or I can create a depth/stencil texture. I can't see the difference except that the texture can be bound and used as a shadow-map or whatever in a shader. So the real question is what is the advantage of a render buffer in lieu of the lack of functionality as a texture. My first guess would be that you can copy out of it easier. Is that it? Cheers! Eric

Share this post


Link to post
Share on other sites
Advertisement
I'm not exactly sure how to answer your questions, but you can probably get some answers by looking at the official documentation of the framebuffer object extension (GL_EXT_framebuffer_object) here:

http://oss.sgi.com/projects/ogl-sample/registry/EXT/framebuffer_object.txt

Share this post


Link to post
Share on other sites
Good point about AA.

Yeah I've read over the spec in the past but when I looked recently I couldn't find where it said why you would use one over the other.

Share this post


Link to post
Share on other sites
You should say what you intend to do.
If you want a Render TO Texture feature, use FBO and of course, you have to attach a texture to the FBO.

The other option is to use a simple texture and glCopyTexSubImage but that's only good if you already have something in your frame buffer. This is useful in other circumstances.

PS : AA is not supported on older GPUs like Radeon 9700 and such + FBO.

Share this post


Link to post
Share on other sites
Quote:
Original post by V-man
You should say what you intend to do.
If you want a Render TO Texture feature, use FBO and of course, you have to attach a texture to the FBO.

The other option is to use a simple texture and glCopyTexSubImage but that's only good if you already have something in your frame buffer. This is useful in other circumstances.

PS : AA is not supported on older GPUs like Radeon 9700 and such + FBO.


That's interesting.
I have a Radeon 9700 pro, and according to GLee, it supports GL_EXT_framebuffer_multisample and GL_EXT_framebuffer_blit. But I am having trouble attaching a multisampled render bufffer to a fbo. The error message is INCOMPLETE ATTACHMENT. I wonder if it's 9700's problem. It is fine if the render buffer is not multisampled.

Share this post


Link to post
Share on other sites
>>Yeah I've read over the spec in the past but when I looked recently I couldn't find where it said why you would use one over the other.

use RB whenever possible cause they have possible benifits of being faster/less memory, u also have biltFB (which enables fast blitting between FBO's, with resizing possible with colorFBOs)

of course if u need the resulting image as a texture u have no option but to bind a texture to it + not use a RB

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!