Get RAPTOR

RaptorRtPostToggles

Post effects the Ray-traced preview and the 3D view can switch off.

NamespaceAssemblyKindStability
Raptor.Render.EditorToolsRaptorRender.Editorclasspreview, since 0.1.0

Only the element provider API is supported.

public static class RaptorRtPostToggles

Fields

All

public static readonly Element[] All;

Every element in settings order: All post-processing, the Game volume master, then the other elements.

Properties

Applied

public static bool Applied { get; }

Whether the current set is applied now. While it is applied, features may be switched off in memory.

Current

public static Scope Current { get; }

The set that applies now: the Ray-traced preview's set while the preview is on, otherwise the 3D view's set.

Methods

Apply

public static void Apply(bool previewOn)

When previewOn is true, applies the current set (Current). When false, restores everything as it was before.

ParameterTypeDescription
previewOnboolTrue to apply the current set; false to restore.

IsOn

public static bool IsOn(Element e)

Same as IsOn(Scope.Rt, e).

ParameterTypeDescription
eElementThe element.

Returns: True if the element is on.

IsOn

public static bool IsOn(Scope s, Element e)

Returns whether element e is on in set s. Elements are on by default; the Viewport set's All toggle starts from the view's current state.

ParameterTypeDescription
sScopeThe set.
eElementThe element.

Returns: True if the element is on.

IsOptional

public static bool IsOptional(Element e)

Returns whether the element is listed only when it has a provider. The optional elements are SSAO, Haze, PsxDither and Outlines.

ParameterTypeDescription
eElementThe element.

Returns: True for an optional element.

IsRegistered

public static bool IsRegistered(Element element)

Returns whether the element has a provider, built in or registered.

ParameterTypeDescription
elementElementThe element.

Returns: True if it has a provider.

Label

public static string Label(Element e)

Returns the element's label in the settings (fixed ASCII text).

ParameterTypeDescription
eElementThe element.

Returns: The label.

Present

public static bool Present(Element e)

Returns whether the element has something to switch in this project (see Visible).

ParameterTypeDescription
eElementThe element.

Returns: True if there is something to switch.

Providers

public static ElementProvider[] Providers()

Returns a snapshot of the providers in All order.

Returns: The providers.

RegisterElement

public static bool RegisterElement(Element element, Func<ScriptableRendererFeature, bool> matchesFeature)

Registers a renderer-feature element (see ElementProvider.Feature).

ParameterTypeDescription
elementElementThe element.
matchesFeatureFunc<ScriptableRendererFeature, bool>Returns true for the renderer feature that represents the element.

Returns: False when the element already has a provider.

Call from an [InitializeOnLoad] static constructor on the main thread.

RegisterElement

public static bool RegisterElement(Element element, Type volumeComponent, Action<VolumeComponent> switchOff)

Registers a volume element (see ElementProvider.Volume).

ParameterTypeDescription
elementElementThe element.
volumeComponentTypeThe volume component's type.
switchOffAction<VolumeComponent>Switches the component off in a profile.

Returns: False when the element already has a provider.

Call from an [InitializeOnLoad] static constructor on the main thread.

RegisterElement

public static bool RegisterElement(ElementProvider provider)

Registers provider. If its element already has a provider, the first one is kept.

ParameterTypeDescription
providerElementProviderThe provider.

Returns: False when the element already has a provider.

Call from an [InitializeOnLoad] static constructor on the main thread.

Set

public static void Set(Element e, bool on)

Same as Set(Scope.Rt, e, on).

ParameterTypeDescription
eElementThe element.
onboolTrue to switch it on.

Set

public static void Set(Scope s, Element e, bool on)

Switches element e in set s, saved as an editor preference. Re-applies immediately while the toggles are applied.

ParameterTypeDescription
sScopeThe set.
eElementThe element.
onboolTrue to switch it on.

Visible

public static Element[] Visible()

Returns the elements listed in the settings, in All order. An optional element without a registered provider is not listed.

Returns: The elements.

VisibleCount

public static int VisibleCount()

Returns the number of elements Visible returns.

Returns: The count.