SFML community forums
Help => Graphics => Topic started by: msteele on March 24, 2011, 08:59:38 am
-
What is the best way to achieve a gaussian or similar-looking blur effect in or under SFML?
I took a look at this old post http://www.sfml-dev.org/forum/viewtopic.php?t=2667&sid=f57a3d6fdd5f5b99ce991103c43b7c92. It uses motion blur, not gaussian, but even so I figured it would be a start. I couldn't get past. (I have sample code to dissect if you think that will help)
Texture "framebuffer" not found in post-effect
Texture "blurred" not found in post-effect
I have also tried this OpenGL technique. It appears to do nothing (in the frame loop: clear->draw->this_opengl->display). I don't know anything about OpenGL though, maybe I missed some initialization?
float q = .90;
glAccum(GL_MULT, q);
glAccum(GL_ACCUM, 1-q);
glAccum(GL_RETURN, 1.0);
glFlush();
I am hoping there is a way to do this with SFML that doesn't involve converting between many image representations and carting the whole thing off to another library which I'm not familiar with. But if it does come to that, any suggestions?
Thanks in advance,
-
You should look into shader.
-
Alright, thanks. Now on to the arduous process of compiling another library... ;)
-
Now on to the arduous process of compiling another library... ;)
There's no need to, SFML supports shaders. Take a look at sf::Shader and GLSL.
-
Now on to the arduous process of compiling another library... ;)
There's no need to, SFML supports shaders. Take a look at sf::Shader and GLSL.
Oh, I just meant sfml2. sfml1.6 only has pfx.
-
Now on to the arduous process of compiling another library... ;)
There's no need to, SFML supports shaders. Take a look at sf::Shader and GLSL.
Oh, I just meant sfml2. sfml1.6 only has pfx.
those are exactly the same shaders (pixel/fragment shaders) which sfml 2.0 uses. sfml 2.0 just gets rid of a couple of sfml specific key words in order to make shaders exactly like GLSL shaders.
-
oh, well I got it all set up with sfml2. But that's good to know.