crt.mov
This is an asset for Unity's built-in render pipeline. It is a screen effect that runs on a Camera, so it will effect
everything rendered by the target Camera.
The effect supports the following features
- Curved monitor
- Scanline colorization
- Color crunching by color channel
- Color dithering (16 and 64)
- Greyscale
- Vignette
- Monitor glow
- Monitor border
- Animitable properties
There is a sample scene that will demonstrate some of the features.
- Load the scene at
Assets/CRT-Free/Scenes/Sample-CRT.unity - Observe that the
Main CameraGameObject has aCRTCameraBehaviourcomponent. This is the critical component for the effect. - Observe that
Demo ObjectGameObject has aCRTDemoBehaviourcomponent. This script is used in the demo scene, and illustrates how to interact with the effect in runtime.
To setup the CRT effect in a new scene,
-
Add the
CRTCameraBehaviourcomponent directly to theCamerathat you want to effect.-
On the new
CRTCameraBehaviourcomponent, select a value forstartConfig. -
On the new
CRTCameraBehaviourcomponent, select a value forcrtRenderSettings. The asset comes with aCRTRenderSettings.assetthat you should use. This file just controls whichMaterialis used.
-
-
You can create a custom
CRTDataObjectby right clicking and clicking Create/BrewedInk/CRT-DataConfig.
In the CRTCameraBehaviour file, uncomment the [ImageEffectAllowedInSceneView] attribute.
You can disable the CRTCameraBehaviour component.
When you create a CRTDataObject, you can control the following properties. The tooltips explain what each property does.
[Tooltip("A value of 0 means no down-sampling. Any number above 1 will down-sample the texture by the value.")]
public int pixelationAmount;
[Tooltip("Each channel controls the maximum amount of values for that channel. A value of 0 means infinite values.")]
public ColorChannels maxColorChannels;
[Tooltip("0 means no dithering. 1 means all dithering. Dithering will help shade a color crunched image to look like it has more coloring that it really does. " +
"This dithering uses a 4x4 bayer dithering matrix.")]
[Range(0,1f)]
[FormerlySerializedAs("dithering")]
public float dithering4 = 0f;
[Tooltip("0 means no dithering. 1 means all dithering. Dithering will help shade a color crunched image to look like it has more coloring that it really does. " +
"This dithering uses a 8x8 bayer dithering matrix.")]
[Range(0,1f)]
public float dithering8 = 0f;
[Tooltip("Controls the dark vignette around the inside of the screen")]
[Range(0,1f)]
public float vignette = .1f;
[Tooltip("Controls how visible the inner picture is.")]
[Range(0f, 20f)]
public float innerCurve = 20;
[Tooltip("Controls how curved the monitor is")]
[Range(0f, .5f)]
public float monitorCurve = .1f;
[Tooltip("Controls how big the inner monitor is")]
public ScreenDimensions monitorOutterSize = new ScreenDimensions{ height = .1f, width = .1f};
[Tooltip("Controls how zoomed in the camera is")]
[Range(0f, 2f)]
public float zoom = 1f;
[Tooltip("A detail texture for the monitor")]
public Texture2D monitorTexture;
[Tooltip("A tint color for the monitor")]
public Color monitorColor = Color.grey;
[Tooltip("The higher the value, the darker the inner monitor section")]
[Range(0,1f)]
public float innerMonitorDarkness = .6f;
[Tooltip("The higher the value, the shinier the inner monitor section")]
[Range(0, 1f)]
public float innerMonitorShine = .1f;
[Tooltip("Controls the horizontal scan color lines")]
public ColorScan colorScans = new ColorScan
{
greenChannelMultiplier = .1f, redBlueChannelMultiplier = .15f, sizeMultiplier = 2
};