Skip to content

Game.Settings.SSGIQualitySettings

Assembly: Assembly-CSharp
Namespace: Game.Settings

Type: class

Base: QualitySetting

Summary:
Wrapper for the Screen-Space Global Illumination (SSGI) quality options. This class exposes UI-configurable settings (including slider metadata via attributes) and maps them to the HDRP GlobalIllumination volume component. It also provides predefined quality presets (Disabled, Low, Medium, High) which are registered in the static constructor. Instances can be constructed from a quality Level and a VolumeProfile to bind to the scene's GlobalIllumination component and apply settings at runtime.


Fields

  • private static GlobalIllumination m_SSGIComponent
    Reference to the HDRP GlobalIllumination Volume component used to apply this setting's values at runtime. Created via CreateVolumeComponent(profile, ref m_SSGIComponent) in the constructor that accepts a VolumeProfile.

  • private static SSGIQualitySettings highQuality
    Private static read-only preset for the High quality level. Values:

  • enabled = true
  • fullscreen = false
  • raySteps = 128
  • denoiserRadius = 0.5f
  • depthBufferThickness = 0.001f
  • halfResolutionPass = false
  • secondDenoiserPass = true

  • private static SSGIQualitySettings mediumQuality
    Private static read-only preset for the Medium quality level. Values:

  • enabled = true
  • fullscreen = false
  • raySteps = 64
  • denoiserRadius = 0.5f
  • depthBufferThickness = 0.001f
  • halfResolutionPass = false
  • secondDenoiserPass = true

  • private static SSGIQualitySettings lowQuality
    Private static read-only preset for the Low quality level. Values:

  • enabled = true
  • fullscreen = false
  • raySteps = 32
  • denoiserRadius = 0.75f
  • depthBufferThickness = 0.001f
  • halfResolutionPass = true
  • secondDenoiserPass = true

  • private static SSGIQualitySettings disabled
    Private static read-only preset that disables SSGI:

  • enabled = false

These presets are registered with QualitySetting.RegisterSetting in the static constructor.

Properties

  • public bool enabled { get; set; }
    Controls whether SSGI is enabled. Marked with [SettingsUIHidden] on the property in the original source (this hides it in some UIs). When false, IsOptionsDisabled will return true (unless the whole setting is disabled by base.disableSetting), which will disable dependent UI controls.

  • public bool fullscreen { get; set; }
    Maps to GlobalIllumination.fullResolutionSS (whether to run SSGI in full resolution or not).

  • public int raySteps { get; set; }
    Number of ray steps for SSGI. Decorated with [SettingsUISlider(min = 16f, max = 128f, step = 1f, unit = "integer")]. Mapped to GlobalIllumination.m_MaxRaySteps.

  • public float denoiserRadius { get; set; }
    Denoiser radius for the SSGI denoiser. Decorated with [SettingsUISlider(min = 0.001f, max = 1f, step = 0.1f, unit = "floatSingleFraction")]. Mapped to GlobalIllumination.m_DenoiserRadiusSS.

  • public bool halfResolutionPass { get; set; }
    Whether to run a half-resolution denoiser pass (mapped to GlobalIllumination.m_HalfResolutionDenoiserSS).

  • public bool secondDenoiserPass { get; set; }
    Whether to use a second denoiser pass (mapped to GlobalIllumination.m_SecondDenoiserPassSS).

  • public float depthBufferThickness { get; set; }
    Thickness value used when sampling the depth buffer to avoid artifacts. Decorated with [SettingsUISlider(min = 0f, max = 0.5f, step = 0.01f, unit = "floatSingleFraction")]. Mapped to GlobalIllumination.depthBufferThickness.

Note: The attribute decorations provide UI metadata (slider ranges, steps, hidden attributes) for the game's settings UI. The property accessors are normal auto-properties so values are stored per-instance.

Constructors

  • static SSGIQualitySettings()
    Static constructor. Registers the four preset instances with the QualitySetting system:
  • Level.Disabled -> disabled
  • Level.Low -> lowQuality
  • Level.Medium -> mediumQuality
  • Level.High -> highQuality

  • public SSGIQualitySettings()
    Default parameterless constructor. Leaves properties at default values (unless overridden by callers).

  • public SSGIQualitySettings(Level quality, VolumeProfile profile)
    Constructs and binds this setting instance to a HDRP VolumeProfile by creating the GlobalIllumination component via CreateVolumeComponent(profile, ref m_SSGIComponent) and then applying the stored preset for the requested quality via SetLevel(quality, apply: false). After construction, call Apply() to push values to the bound volume component.

Methods

  • public override void Apply()
    Applies this instance's property values to the bound GlobalIllumination volume component (m_SSGIComponent). For each mapped field it calls ApplyState(componentField, value) to set the volume component parameters if the component exists. Specifically maps:
  • m_SSGIComponent.enable <- enabled
  • m_SSGIComponent.fullResolutionSS <- fullscreen
  • m_SSGIComponent.m_MaxRaySteps <- raySteps
  • m_SSGIComponent.m_DenoiserRadiusSS <- denoiserRadius
  • m_SSGIComponent.depthBufferThickness <- depthBufferThickness
  • m_SSGIComponent.m_HalfResolutionDenoiserSS <- halfResolutionPass
  • m_SSGIComponent.m_SecondDenoiserPassSS <- secondDenoiserPass

Apply relies on m_SSGIComponent being non-null (set by the VolumeProfile constructor). ApplyState and CreateVolumeComponent are provided by the base QualitySetting class or utilities.

  • public override bool IsOptionsDisabled()
    Returns whether the UI options for this setting should be disabled. Behavior:
  • If base.disableSetting is true, returns true (options disabled).
  • Otherwise returns !enabled (options disabled when SSGI is turned off). This method is also referenced by the [SettingsUIDisableByCondition] attribute to enable/disable UI controls.

Usage Example

// Example: bind to a VolumeProfile and apply a quality preset at runtime
var profile = /* obtain a VolumeProfile reference from your Volume/scene */;
var ssgiSetting = new SSGIQualitySettings(Level.High, profile);

// The constructor sets internal values according to the preset.
// Call Apply to push them to the bound GlobalIllumination volume component.
ssgiSetting.Apply();

// You can also modify properties then re-apply:
ssgiSetting.raySteps = 96;
ssgiSetting.enabled = true;
ssgiSetting.Apply();

Notes: - The class uses HDRP's GlobalIllumination volume component; ensure the project uses HDRP and the VolumeProfile contains the GlobalIllumination component (CreateVolumeComponent will create or fetch it). - UI attributes (SettingsUISlider, SettingsUIHidden, SettingsUISection, etc.) are used by the game's settings UI system to render controls and behavior.