Recommended Posts

How do i blur the screenbuffer or parts of it? I''ve scanned several forums and irc channels, but i cant seem to find theory or sources for this effect. Its a very popular one, atleast in recent demos and intros (in software, not many hardware acc. demos use it).
If you''ve seen "heaven seven" or "past" by OJuice, you''ll know what i mean. Text, images or even the whole screen is blurred horizontally, from almost no blurring, to 100%. By horizontal, i mean that it only blurs the current scanline, it doesnt seem to account for the pixels above or below.
But blurring isnt that hard.. What i cant grasp is the fact that the image also seem to be stretched along the scanline. Anyway, does anyone know how to do this? And how on earth do they manage to perform it so fast? I always though that blurring the whole screen would suck up most of the cpu-time.

Share this post

Link to post

Share on other sites

Do you want to do this in hardware or software? If it's software, then you'll want to be coding your blur routine in ASM using MMX. If it's in hardware, then you can use some tricks.

One such trick is to render your scene to smaller texture, and then render a quad the size of the screen mapped with that texture to the screen. The smaller the texture, the more blur.

If you want motion blur, there's a technique you can use that is very fast, but, for which, according to the OpenGL (and I assume DirectX) specifications, the results are undefined! That is simply to not clear the framebuffer but instead to render a semi-transparent quad to the screen that is your background color, and then render the current frame. The assumption is that the framebuffer will contain the previous frame. But it is not quaranteed to. So, although the technique is likely to work, it won't necessarily.

Share this post

Link to post

Share on other sites

This is a fairly easy effect to do in a demo; look at tutorials on convolution matrices for more info.

It''s important to recognize, tho, that this technique is limited. It''s completely possible to have an imgae get more and more blurry... it is not so possible to have the image very blurry to begin with, at least in realtime. And it''ll only work for static images. To produce an appreciable blur without a need for several frames for it to get blurry, you''ll have to use a rather large convolution matrix, which is very very processor intensive and probably cannot be done in realtime.