Advertisement

opengl post process question

Started by July 09, 2019 05:02 AM
2 comments, last by _Silence_ 5 years, 6 months ago

Hello, 

I need to add post processing effects to an old existing opengl based renderer.  I know the usual pattern is to create an offscreen frame buffer object and render to that, then feed the off screen texture as input to the post processor when rendering to the main/default FBO.  

However, I'm wondering if I could do something simpler: can I just render to the default FBO as usual.  Then when the scene is done but before presenting, copy the default FBO texture to a secondary texture T.  Then input T into post processor and keep drawing to the default FBO.  Any issues with this approach or performance considerations?  Target platform is Windows. 

-----Quat

I think extra texture copy will cause -perf?
I am not sure that second option really simpler than first one.
 

Advertisement
19 hours ago, Quat said:

However, I'm wondering if I could do something simpler: can I just render to the default FBO as usual.  Then when the scene is done but before presenting, copy the default FBO texture to a secondary texture T.  Then input T into post processor and keep drawing to the default FBO.  Any issues with this approach or performance considerations?  Target platform is Windows.

You can. You will normally not notice any performance loss. In the first scenario you render on-screen, then blit in an fbo, then use a shader, then blit the result back again on screen. On the second one you render in an fbo, then possibly use a shader (or do it all in the same final shader), then blit it on-screen. The difference is one blit and potentially one shader, which is negligible.

Also note that making an old renderer renders in an FBO instead of the on-screen one should not be a good deal (just an fbo binding at the beginning of the frame and each time you unbind potential other fbos you might be using).

This topic is closed to new replies.

Advertisement