Tag Archives: Shader

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

Unity: GrabPass distortion shader example updated

UnityA few months ago, I was providing help in the Unity forums where someone asked how to add animated distortions to his game. Since I’m a big fan of distortion effects, I couldn’t resist to create a simple shader example.

The example was created in Unity 4 at this time and I recently have been made aware it doesn’t work well in new and shiny Unity 5, so I updated it to support just that. I also extended the shader slightly, which now accepts an optional intensity mask that describes where distortions are applied.

Here is the initial video I recorded showing the effect in Unity 4. Keep in mind, it’s just an example and most likely not ready to be used in your upcoming triple-A mobile title 😉

Download example project

Visit forum post