Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I want to basically make a blur shader in glsl and use it like Windows 7 does for Windows. I want to for example draw something and then blur a rectangle, then draw text over it.

If someone could point me in the right direction on how to do this I'd be very grateful.

Thanks

share|improve this question

1 Answer 1

up vote 3 down vote accepted

This kind of effect is known as a Guassian blur. It's a relatively common effect, so you can find information about the algorithm and even some sample shaders relatively easily: for example, here, here and here were the first three Google results that looked vaguely worthwhile.

The general idea is that you're going to have to render the scene you want blurred into a render target texture, then bind that texture for a second render phase during which you'll compute the blur effect.

To render sharp images on top of the blur (for example, your text), you can render the blurring phase into a render target texture as well, and bind that texture for the final pass where you'd render your text over the scene.

You may also want to look for discussion of GPU post-processing systems to get a feel for how you might architect you render pipeline to be generally scalable to these sorts of multi-phase effects.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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