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 Answer 1

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\$

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.