Some gaussian blur with GLSL, a bit of FBOs and a helping of GtkXPaned

I wrote some boilerplate C++-code to have a simple framework for my future endevours with OpenGL 2.0 and GLSL in particular. The first thing I wanted to try is some image-processing function… a gaussian blur.

thumbnail of GLSL blur-example
(click to play back, ogg/theora, ~1.4 MBytes)

Horay! Now I’m going to rewrite the whole effects-plugin-stack for Gimp with that… ehm… no I’m not. Just kidding, sorry :)

Also I did try to wrap my mind around using OpenGL’s frame-buffer-objects (the nicer variation of pbuffers if you will). While trying to think up some example to use FBOs with, I wondered how fast the drawing of mouse-gestures could be. I’m a bit annoyed of the “responsiveness” of mouse-gesture trails in Firefox (under Windows it’s ok, but under Linux it leaves something to be desired speed-wise). So I went for this. Ok, it’s no fair comparison… my example is small, lean and using OpenGL… Firefox is a full-fledged application doing its drawing with… ehm… well not with OpenGL so much I’m sure of. Do they use gdk under Linux for non-UI graphics? Hm… I’ve no idea at all. Nevermind, take a look…

thumbnail of clip
(click to play back, ogg/theora, ~1.2 MBytes)

BTW those two examples run vsynced and behave very nicely towards the machine running at 90 fps (does not matter if maximized to fullscreen or not). The hit on the CPU is around 1%.

Lastly I got my act together and tar’ed up the sourcecode for GtkXPaned… or rather the current state of affairs regarding it. It is not done yet. Some bugs remain and it’s greatly untested. But if someone finds this interesting they can give it a spin. I remember one of the people working on gnumeric once asked me about it, but that’s about a year ago or so. I’ve lost the email and cannot remember the name anymore. What could they have wanted form such an widget? Where would such a specific UI-element fit anywhere in a spreadsheet like gnumeric? Anyways here the code (SHA1SUM). If you give it a try, please read BUGS and the comments in the sourcecode at the top, I really mean it. Should you get it compiled you can

One Response to “Some gaussian blur with GLSL, a bit of FBOs and a helping of GtkXPaned”

  1. Francois Richard Says:

    Hi, I was looking for a way to implement gaussian blur, and it looks like you achieved exactly the effect I was looking for. Would it be possible for you to send me a tutorial, or perhaps the source code, or only the OpenGL instructions / concepts used to get it done ? Also, I would really like if you replied by e-mail.
    Thank you for your time.

Leave a Reply