Original Post
Hi, I have been trying to do a full-screen blur (ideally like the Gaussian Blur filter in Photoshop) without much luck. I've searched around alot and have not found anything that seems to work at a practical speed... I know it's a pretty common effect, so I must be missing something. I have tried the blur shader from Delphi3d's HDR sample, but couldn't get it to work with reasonable quality at a more than a few FPS. Eventually I came up with a modified version of the Nehe #36 algorithm. I have the part of the image I want to blur in an FBO texture, bind it, set up blending with glBlendFunc(GL_SRC_ALPHA, GL_ONE), and render it many times in a increasing circle pattern: Of course, this is VERY slow since I have to render it so many times to create a decent-quality blur: Image I have tried downsampling to about 128x128 and using GL_LINEAR filtering. This looks decent, but in motion and composited with another image it's terrible: Image Are there some tricks for this that I'm missing? [smile] It only needs to run on a QuadroFX 1400Go and GeForce6600 and higher nVidia cards on the latest FreeBSD and Windows drivers, so any fancy shader (I am using GLSL) or extension tricks should be OK. (It would be a nice bonus to work on ATi's ~X1600+ cards, but not needed.) Thanks, - Pete
glBegin(GL_QUADS);
for(float radius = 0.0f; radius <= 0.1f; radius += 0.01f)
{
for(float angle = 0.0f; angle <= 2.0f*pi; angle += pi/32.0f)
{
glColor4f(1.0f, 1.0f, 1.0f, 0.005f);
float offset_x = radius*cos(angle);
float offset_y = radius*sin(angle);
glTexCoord2f(0.0f, 1.0f);
glVertex2f(-1.0f+offset_x, -1.0f+offset_y);
glTexCoord2f(0.0f, 0.0f);
glVertex2f(-1.0f+offset_x, 1.0f+offset_y);
glTexCoord2f(1.0f, 0.0f);
glVertex2f(1.0f+offset_x, 1.0f+offset_y);
glTexCoord2f(1.0f, 1.0f);
glVertex2f(1.0f+offset_x, -1.0f+offset_y);
}
}
glEnd();