‘Video Glitches‘ is a collection of post-processing effects for Unity that simulate several common failures in television and video signals, both analog and digital.
Add ‘Video Glitches‘ is easy. Select the camera you’re going to use (usually called ‘Main Camera‘) in the ‘Hierarchy‘ editor window, then click on ‘Add Component‘ button in the ‘Inspector‘ window.
When you add one, you will see something like:
All effects have a part in common (1). In that part you can change the intensity of the effect and the mode between ‘Screen‘, ‘Layer‘ and ‘Distance‘. Area 2 will depend on the type of effect.
There are three different modes. The first one is ‘Screen‘ and is the one used by default. It makes the effect apply to the whole screen. Another mode is ‘Layer‘ and with it you can apply the effect only to the layers you want.
Simply select the layers (1) you want and they will be the only ones in which the effect is applied. If you see any accuracy faults, you can adjust the sensitivity with ‘Advanced settings‘.
With ‘Distance‘ mode you can select the depth curve to modulate the effects strength. The range starts at the ‘Near‘ distance of the camera and ends at ‘Far‘.
‘Layer‘ and ‘Distance‘ modes add a depth texture to the camera, and may not be available on some mobile platforms. You should also keep in mind that both modes depend on the ‘Far‘ parameter of your camera. If you use a ‘Far‘ too large (default is 1000), you may have precision problems, so I advise you to reduce it as much as possible.
The ‘Color‘ area is used to modify color parameters and you must activate it (the small circle near the label) to be able to use it.
You can configure other options by opening ‘Advanced settings‘.
If you experience some precision errors in the ‘Layer‘ mode, you can minimize them by changing ‘Depth threshold‘ (1).
Do you want that the effects do not affect the scaled time? Uncheck ‘Use scaled time‘ (2).
Finally, you can multiply the value of the time with ‘Time scale‘ (3).
‘Video Glitches‘ supports virtual reality devices (VR). You must use Unity 2017.1 or higher. At the moment, ‘Layer‘ mode does not work in VR mode.
All code is inside the namespace ‘Ibuprogames.VideoGlitchesAsset‘. So if you want to use it you must first import its namespace:
If ‘myCamera‘ is a valid camera and you want to add the effect ‘VideoGlitchBlackWhiteDistortion‘, you should do something like:VideoGlitchBlackWhiteDistortion blackWhiteDistortion = mycamera.gameObject.AddComponent&lt;VideoGlitchBlackWhiteDistortion&gt;();
All the code are well commented, I recommend reading the code if you want more information.
Any questions or suggestions you have, we will be happy to answer you in our mail: