Jump to content
  • Advertisement
Sign in to follow this  
ruzhenchao

the difference between RenderBuffer and textures

This topic is 3553 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

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

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
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!