Unity: Screen transition shader example

UnityA few days ago, I was providing help in the Unity forum, where someone ask how to do a specific screen transition effect. So, I put together an image effect example that uses a texture to describe the transition of a certain pixel.

I think it’s a common and pretty generic approach to this problem and one of the things I like most is that it’s totally content driven. The screen transition is basically encoded in a mask (gray-scale texture, black pixels blends in first, white last), which allows to change the transition by just authoring the texture in a different way. Since the transition is encoded in just one texture channel (alpha) in the example, it cuts down to just 256 individual steps for the transition, but it’s often enough to yield decent results. If you need more, there would be still the option to use more than only¬† the alpha channel though.

In case you’re interested in the example (Unity 5), you can find the download link at the bottom of this post. Please note that it’s an example and might not be ready or the best fit for your game. I believe image effects are a bit heavy on mobile.


Forum Answer

Tweet about this on TwitterShare on RedditPin on PinterestShare on Facebook