Jump to content
  • Advertisement
Sign in to follow this  
Quat

OpenGL opengl post process question

Recommended Posts

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. 

Share this post


Link to post
Share on other sites
Advertisement

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

Share this post


Link to post
Share on other sites
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).

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  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!