0
\$\begingroup\$

I develop 3d menu and sometimes I need to blur only part of the screen. I use a forward rendering. I create a frame buffer object with 3 color attachments. Rendering looks like this:

  • bind fbo
  • render objects which are blurred to the first texture
  • bind the first texture
  • perform vertical blur and save a result in the second texture
  • bind the second texture
  • perform horizontal blur and save a result in the third texture
  • unbind fbo (render to the default fbo)
  • bind the thrid texture
  • render the third texture
  • render objects which are not blurred

I can use subroutines to reduce overhead during switching shaders. I also found the following article . Do you have any other ideas how to optimize above rendering ?

\$\endgroup\$
1
\$\begingroup\$

That is the standard way of doing a Gaussian blur however, you can use only 2 textures like this:

  • bind the original texture
  • blur horizontally to the second texture
  • bind the blurred horizontally texture
  • blur vertically to the original texture
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.