the difference between RenderBuffer and textures

Started by
3 comments, last by Clapfoot 15 years, 6 months ago
What is the difference between RenderBuffer and Texture in FBO techniques?I just can't distinguish them.
Advertisement
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
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).
Thanks a lot!
i.e. RenderBuffer to CPU
Texture to GPU
Is that right?
Thanks again!
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).

This topic is closed to new replies.

Advertisement