Sign in to follow this  
ruzhenchao

the difference between RenderBuffer and textures

Recommended Posts

The RenderBuffer is usually used as the Depth buffer for your Frame Buffer Object. The depth buffer ensures that depth testing can occur while the FBO is drawn to.

The Texture is where the FBO writes the render output to. You can then use glBindTexture to apply the FBO output to any object in your scene.

Giawa

Share this post


Link to post
Share on other sites
Renderbuffers are used when you want to render to a logical framebuffer offscreen, but not use it as a texture. There are several uses for these. Probably the most common use would be to use them as a depth or stencil buffer when rendering to your FBO. Another use would be rendering a scene and reading colour values back to the CPU via glReadPixels.

Textures are used when you want to render a scene and access it on the GPU (via a shader or fixed func).

Share this post


Link to post
Share on other sites
In terms of reading texture data, yes. IIRC, you can't easily read texture data back to the CPU when using FBOs.

In general, you would use a renderbuffer if you want to create a stencil or depth buffer to support your colour rendering OR if you want to do some sort of offscreen rendering into your colour buffer (e.g. to read values back to the CPU).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this