Class TextModeCRTVolume
Shows a camera's picture through a simulated cathode ray tube. Add it to a Volume profile; the TextModeCRTRendererFeature on the URP renderer draws it.
Implements
Inherited Members
Namespace: Scylla.TextMode.URP
Assembly: ScyllaTextMode.URP.dll
Syntax
[Serializable]
[VolumeComponentMenu("Scylla/TextMode CRT")]
[SupportedOnRenderPipeline(typeof(UniversalRenderPipelineAsset))]
public sealed class TextModeCRTVolume : VolumeComponent, IApplyRevertPropertyContextMenuItemProvider, IPostProcessComponent
Remarks
The effect is off until Enable is set, like the other Volume effects. The look comes from a TextModeCRTPreset; without one the default preset is used. Volumes blend nothing between presets: the preset of the highest-priority Volume that sets one wins.
This component only holds the settings. Nothing is drawn unless the active URP renderer has a TextModeCRTRendererFeature and the TextMode module is running. The feature reads the Volume stack of the camera that is rendering, so the Volume's mode (global or local) and layer mask decide which cameras show the CRT. In a camera stack the Volume path draws only on the camera that resolves the final target. A camera that was shown from code through TextModeCRTCameraEffects ignores this component and uses the settings it was given.
Under HDR output the light is handled as described on TextModeCRTRendererFeature, and the injection point is chosen there.
To set it up in the Editor, follow these steps.
- Run the menu item Tools/Scylla/TextMode/Add CRT to URP Renderers, or add a TextMode CRT renderer feature to the URP renderer asset by hand.
- Add a Volume to the scene and give it a Volume profile.
- Choose Add Override, then Scylla, then TextMode CRT.
- Tick Enable, then pick a preset, a quality tier and, if wanted, a source line count.
The same setup from code, for a Volume profile that already exists.
if (profile.TryGet(out TextModeCRTVolume crt))
{
crt.Enable.Override(true);
crt.QualityTier.Override(CRTQualityTier.High);
crt.SourceLines.Override(240);
}
Fields
Enable
Switches the CRT on for cameras inside this Volume. While this is off, or not overridden, the component does nothing.
Declaration
public BoolParameter Enable
Field Value
| Type | Description |
|---|---|
| BoolParameter |
Preset
The TextModeCRTPreset that describes the monitor to simulate. Empty uses the default preset from the TextMode configuration. If no default preset exists either, nothing is drawn.
Declaration
public TextModeCRTPresetParameter Preset
Field Value
| Type | Description |
|---|---|
| TextModeCRTPresetParameter |
QualityTier
Quality of the simulation. Low is a single pass, Medium adds afterglow and glow, High adds halation and a beam width per color channel. The default is Medium.
Declaration
public CRTQualityTierParameter QualityTier
Field Value
| Type | Description |
|---|---|
| CRTQualityTierParameter |
ReadabilityClamp
Limits the settings that cost legibility: softness, curvature, glow and afterglow. Turn it on when text on the screen has to stay easy to read.
Declaration
public BoolParameter ReadabilityClamp
Field Value
| Type | Description |
|---|---|
| BoolParameter |
SourceLines
A fixed number of scanlines for a low-resolution look, such as 240. The picture is scaled down to that many lines before it is drawn. 0 derives the count from the preset's scanline pitch and keeps the camera's resolution.
Declaration
public ClampedIntParameter SourceLines
Field Value
| Type | Description |
|---|---|
| ClampedIntParameter |
Methods
IsActive()
Gets whether the effect should be drawn. URP calls this through UnityEngine.Rendering.IPostProcessComponent, and the renderer feature calls it to decide whether a camera needs the CRT pass at all.
Declaration
public bool IsActive()
Returns
| Type | Description |
|---|---|
| bool | True when Enable is set. |