SFML community forums
Help => Graphics => Topic started by: Elias Daler on July 31, 2014, 05:11:30 pm
-
When you select a level in Super Mario World the screen fades to black and image becomes more and more pixelated over a short period of time. When the level is loaded the same transition happens in reverse.
How can I do something similar in SFML?
(http://seagaia.files.wordpress.com/2012/01/supermarioworldfade2-e1327993623978.png?w=590)
-
You could use a shader.
There's an example of a pixelate shader shipping with the SFML sources.
-
Thanks. That's exactly what I needed! By the way, is there anyway to apply this shader to the sf::RenderWindow, so I don't have to pass sf::Shader to every draw function?
-
Draw your entire scene on a render texture and then draw that render texture to the window with the shader.
-
It is explained in the doc / tutorial, by the way.
-
Thanks, it worked :)