Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: [SOLVED]How can I do this screen transition effect?  (Read 4092 times)

0 Members and 1 Guest are viewing this topic.

Elias Daler

  • Hero Member
  • *****
  • Posts: 599
    • View Profile
    • Blog
    • Email
[SOLVED]How can I do this screen transition effect?
« 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?
« Last Edit: November 08, 2023, 04:43:48 pm by Elias Daler »
Tomb Painter, Re:creation dev (abandoned, doing other things) | edw.is | @EliasDaler

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: How can I do this screen transition effect?
« Reply #1 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.

Elias Daler

  • Hero Member
  • *****
  • Posts: 599
    • View Profile
    • Blog
    • Email
Re: How can I do this screen transition effect?
« Reply #2 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?
Tomb Painter, Re:creation dev (abandoned, doing other things) | edw.is | @EliasDaler

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: How can I do this screen transition effect?
« Reply #3 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.
« Last Edit: August 01, 2014, 03:52:08 pm by zsbzsb »
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: How can I do this screen transition effect?
« Reply #4 on: July 31, 2014, 08:45:31 pm »
It is explained in the doc / tutorial, by the way.
Laurent Gomila - SFML developer

Elias Daler

  • Hero Member
  • *****
  • Posts: 599
    • View Profile
    • Blog
    • Email
Re: How can I do this screen transition effect?
« Reply #5 on: August 01, 2014, 01:19:52 pm »
Thanks, it worked  :)
Tomb Painter, Re:creation dev (abandoned, doing other things) | edw.is | @EliasDaler