Skip to content

Latest commit

 

History

History
100 lines (55 loc) · 5.4 KB

quality-settings.md

File metadata and controls

100 lines (55 loc) · 5.4 KB

Quality Settings

Quality Settings Asset unites every required setting that's normally scattered around different menus and assets in Unity.

image

Quality Debug Widget provides a capability to change the quality level at runtime and modify individual pre-scripted settings.

image

Default Quality Settings

The settings that you can find at Project Settings are drawn in our asset to keep everything in one place.

image

Renderer Features

Some settings such as Ambient Occlusion are represented by a renderer feature.

In Unity, it's already possible to have different Renderers per quality level.

In Quality Settings a shortcut to them is drawn so it's possible to modify them without going down all the references.

The same asset will be modified so all the changes are reflected automatically.

image

You can make changes to the RendererFeatures and they will be reflected automatically at runtime.

At runtime there is a possibility to toggle every possible renderer feature. However, Unity has a natural limitation: every feature should be added at the Editor time, it can't be added at runtime but it can be switched on/off.

Currently, it's provided by the Debug View but in the future, it's easy to connect to the prod-ready flow (e.g. Settings View)

image

Volume Profile

A lot of Post-Processing effects are provided by the Volume feature of URP. The full list of the built-in effects you can find at https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@14.0/manual/EffectList.html

Quality Settings support different sets of VolumeComponents per quality level.

image

The system automatically maintains a global volume on the scene and modifies it accordingly on quality level selection.

image

image

You can make changes to the VolumeProfile and they will be reflected automatically at runtime.

Lens Flare

Presets for Lens Flare are automatically generated for each quality level, and, thus, can be changed individually.

image

The system automatically maintains an instance of the prefab if Lens Flare is enabled.

image

However, the configuration of the Lens Flare (SRP) is stored on the component, not on the asset. Thus, if you modify the prefab itself you will need to switch the quality level to reflect the changes.

image

Simple Fog

Provides a possibility to control Fog per quality level.

image

Fog requires support from the shader side. If it's not supported then Fog will not affect such assets at all.

Custom Behavior at Editor Time

If Update In Editor is ticked then all the aforementioned behavior is applied to the currently open scene automatically.

image

If the game is launched from the Main scene it's always applied at runtime.

Resolution Scale While Previews Render

URP applies the asset's renderScale to every game camera, including the offscreen cameras that draw the character previews and the Passport badge into a RenderTexture, so at the user's Resolution Scale those images come out pixelated. With the FSR filter selected the FSR pass also runs at 100% and writes alpha 1, which turns a camera that clears to transparent into an opaque black square.

UpscalingController (Assets/DCL/Settings/UpscalingController.cs) therefore holds the user's scale and overrides it with renderScale = 1 and the Auto filter while anyone requires it:

  • Shown character previews, through CharacterPreviewEventBus.OnAnyShownChangedEvent: the first preview that shows acquires the override and the last one to hide or dispose releases it. Every CharacterPreviewControllerBase is covered without registration.
  • Explicit requesters via RequireFullRenderScale(owner) / ReleaseFullRenderScale(owner), keyed by owner so an unbalanced call cannot leave the scale stuck. The Passport badge camera uses this while the Passport is open, and the Navmap section while it is active.

A Resolution Scale change made while the override is held is stored and applied on release.