Search code examples
openglgraphicsframebufferfbo

OpenGL FBO texture width height in games


I have a question regarding Frame buffer objects in games. If a user changes the screen resolution in a game multiple times, what happens with the FBO sizes for post-processing etc? Do you have to delete all the created FBO's and create new ones? Is it better to resize them? or is it better to create a handler that creates new ones if they do not already exist and save the old(the user may switch back to the old screen resolution) ones? (the latest proposal may consume a tremendous amount of graphics memory if the user is constantly changing the screen resolution).

Thanks in advance.


Solution

  • According to me, it is not really a problem to have some latences when you "resize" your window. When you resize the window, I guess you don't care about performances. According to me, when you resize the window, you are not really playing, and when you are playing, generally you use full screen mode. So there is two possibilities : The first one, you fix size of all your frame buffers, it could be ok for simple game but not really suitable for "complex games".

    The second one is approximately what you said. FBO exist for rendering something to them and nowadays it could be dynamic, so the only purpose to keep several size of fbo is to eschew latencies when you resize. IMHO, you can don't care about these kind of latences and just remove and create again FBOs.