SFML community forums

Help => Graphics => Topic started by: Elias Daler on July 31, 2014, 05:11:30 pm

Title: [SOLVED]How can I do this screen transition effect?
Post 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)
Title: Re: How can I do this screen transition effect?
Post by: Jesper Juhl on July 31, 2014, 05:17:13 pm
You could use a shader.
There's an example of a pixelate shader shipping with the SFML sources.
Title: Re: How can I do this screen transition effect?
Post by: Elias Daler on July 31, 2014, 06:35:14 pm
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?
Title: Re: How can I do this screen transition effect?
Post by: zsbzsb on July 31, 2014, 06:50:09 pm
Draw your entire scene on a render texture and then draw that render texture to the window with the shader.
Title: Re: How can I do this screen transition effect?
Post by: Laurent on July 31, 2014, 08:45:31 pm
It is explained in the doc / tutorial, by the way.
Title: Re: How can I do this screen transition effect?
Post by: Elias Daler on August 01, 2014, 01:19:52 pm
Thanks, it worked  :)