Sign in to follow this  
sofakng

OpenGL Do I need to use pBuffer for rendering to textures?

Recommended Posts

I'm looking for the easiest, platform independant way to render something to a texture. I've asked on the GarageGames forums (eg. Torque Game Builder) and they said I should read up on pBuffers. However after doing some searching I found the OpenGL funciton called glCopyTexSubImage2D(). glCopyTexSubImage2D seems like it would be *much* easier to use than a pBuffer (I have no idea what a pBuffer is but it seems more complicated). So, can I use glCopyTexSubImage2D for rendering to a texture? If so, what are the pros/cons versus using a pBuffer? (or other methods?) Thanks, John

Share this post


Link to post
Share on other sites
Look up EXT_framebuffer_object. That's definitely the way to do it these days. PBuffers were used before the framebuffer_object extension became available, but are a lot slower (apparently; I never used them).

Share this post


Link to post
Share on other sites
Ahhh, excellent!

Are there any really dumbed-down tutorials on how to use this?

I'm only doing 2D graphics and I'd just like to create a simple bloom effect by rendering my screen to a smaller texture (via FBOs?) and then stretch it back over the screen using alpha blending...

Share this post


Link to post
Share on other sites
Using glCopyTexSubImage2D() is indeed very simple. From what I've read, it should also be quite efficient, since everythinh is happening on the graphics card itself.

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