Class TextModeCRTHDR
The registration point for HDR display information. A render pipeline package can register a source that knows about its own settings; the CRT asks here every frame.
Inherited Members
Namespace: Scylla.TextMode.CRT
Assembly: ScyllaTextMode.CRT.dll
Syntax
public static class TextModeCRTHDR
Remarks
HDR mask mode uses the answer to decide how much headroom above paper white the display has; see CRTHDR. The registration is static state that lives as long as the domain, so a package that registers a source must unregister it when its pipeline stops being the active one.
The following example registers a source that reports a fixed display, and removes it again.
private sealed class FixedHDRSource : ITextModeCRTHDRDisplaySource
{
public bool TryGetDisplay(Camera camera, out CRTHDRDisplay display)
{
display = new CRTHDRDisplay(true, true, 203f, 0.01f, 1000f);
return true;
}
}
var source = new FixedHDRSource();
TextModeCRTHDR.Register(source);
var display = TextModeCRTHDR.GetDisplay(Camera.main);
TextModeCRTHDR.Unregister(source);
Properties
Source
Gets the registered source, or null when the engine's HDR output settings are used.
Declaration
public static ITextModeCRTHDRDisplaySource Source { get; }
Property Value
| Type | Description |
|---|---|
| ITextModeCRTHDRDisplaySource | The source last passed to Register(ITextModeCRTHDRDisplaySource), or null. |
Methods
GetDisplay(Camera)
Returns what the display shows for a camera, from the registered source or, without one, from the engine's HDR output settings. The engine's settings are also used when the registered source cannot answer.
Declaration
public static CRTHDRDisplay GetDisplay(Camera camera)
Parameters
| Type | Name | Description |
|---|---|---|
| Camera | camera | The camera that draws the picture, or null when it is not known. |
Returns
| Type | Description |
|---|---|
| CRTHDRDisplay | What the display reports; SDR on a standard display. |
GetEngineDisplay(Camera)
Returns what the engine's HDR output settings report for the main display. HDR counts as active for a camera only when the camera renders in HDR. When the display supports HDR but HDR output is switched off, the result is available but not active, with all luminance values 0.
Declaration
public static CRTHDRDisplay GetEngineDisplay(Camera camera)
Parameters
| Type | Name | Description |
|---|---|---|
| Camera | camera | The camera that draws the picture, or null when it is not known. |
Returns
| Type | Description |
|---|---|
| CRTHDRDisplay | What the display reports; SDR on a standard display. |
Register(ITextModeCRTHDRDisplaySource)
Registers the source of the active render pipeline package, replacing any earlier one.
Declaration
public static void Register(ITextModeCRTHDRDisplaySource source)
Parameters
| Type | Name | Description |
|---|---|---|
| ITextModeCRTHDRDisplaySource | source | The source. Null clears the registration. |
Unregister(ITextModeCRTHDRDisplaySource)
Removes a source, for example when its render pipeline is no longer active. Nothing happens when another source has replaced it in the meantime.
Declaration
public static void Unregister(ITextModeCRTHDRDisplaySource source)
Parameters
| Type | Name | Description |
|---|---|---|
| ITextModeCRTHDRDisplaySource | source | The source to remove. Null is ignored. |