Jump to content
  • Advertisement
Sign in to follow this  
ArKano22

FBO resize

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

Is it possible to resize a FBO? I have a fbo with 4 texture attachments that serve as fullscreen post-processes of my main framebuffer. When i resize the window, i want the FBOs to resize with it. Is there an efficient way of doing this?

Share this post


Link to post
Share on other sites
Advertisement
The FBO resizes if the size of the attachments changes. In my experience though changing the size of the FBO is hell slow and should be avoided. I use an FBO manager which keeps track of created FBOs and their size so I query the manager for an FBO of the given size and if one exists it is handed out otherwise newly created. I heard under certain Windows versions this is exactly the other way 'round ( hence reusing an FBO with different sizes is better ).

Share this post


Link to post
Share on other sites
Couldn't you just use the appropriate texture coordinates for your textures. Resizing means to delete and recreate resources which is not a good idea.

Share this post


Link to post
Share on other sites
Quote:
Original post by V-man
Couldn't you just use the appropriate texture coordinates for your textures. Resizing means to delete and recreate resources which is not a good idea.


Do you mean to have the FBO size set as maximum window size and just change the texture coordinates? Well, that´s an option mut if my maximum resolution is 1024x768 and i´m running at 640x480, i´m wasting a lot of video memory, right?

I do not need the resizing to be smooth or fast, so recreating the buffers is not a problem. I just wanted to know if there was a better solutio.

Share this post


Link to post
Share on other sites
Yes, it wastes video memory.
If you prefer to resize, then just call glTexImage again with the size you want and the driver will delete the old buffer and make a new one. (I'm assuming you have textures attached to an FBO)

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!