Class AutomaticDynamicResolutionFeature
This OpenXRFeature enables the use of Automatic Viewport Dynamic Resolution in OpenXR.
Inherited Members
Namespace: UnityEngine.XR.OpenXR.Features
Assembly: Unity.XR.OpenXR.dll
Syntax
public class AutomaticDynamicResolutionFeature : OpenXRFeature
Fields
maxResolutionScalarLimit
The maximum possible value of the resolution scalars.
Declaration
public const float maxResolutionScalarLimit = 2
Field Value
Type | Description |
---|---|
float |
minResolutionScalarLimit
The minimum possible value of the resolution scalars
Declaration
public const float minResolutionScalarLimit = 0.05
Field Value
Type | Description |
---|---|
float |
Properties
maxResolutionScalar
Stores the current maximum resolution scalar. It is bounded from below by the current value of minResolutionScalar, and from above by maxResolutionScalarLimit.
Declaration
public float maxResolutionScalar { get; }
Property Value
Type | Description |
---|---|
float |
Remarks
Only the getter is public. You can change this value in: "Project Settings -> XR Plug-in Management -> OpenXR -> Automatic Viewport Dynamic Resolution"
minResolutionScalar
Stores the current minimum resolution scalar. It is bounded from below by minResolutionScalarLimit, and from above by the current value of maxResolutionScalar.
Declaration
public float minResolutionScalar { get; }
Property Value
Type | Description |
---|---|
float |
Remarks
Only the getter is public. You can change this value in: "Project Settings -> XR Plug-in Management -> OpenXR -> Automatic Viewport Dynamic Resolution"
usingSuggestedResolutionScale
Are we currently using the suggested resolution provided by the extension(s), or are we disregarding it and not updating resolution automatically. Default is true.
Declaration
public static bool usingSuggestedResolutionScale { get; }
Property Value
Type | Description |
---|---|
bool |
Remarks
Call SetUsingSuggestedResolutionScale(bool) to change this value. Only the getter is public.
Methods
IsAutomaticDynamicResolutionScalingSupported()
Determines if automatic dynamic resolution scaling is supported.
Declaration
public static bool IsAutomaticDynamicResolutionScalingSupported()
Returns
Type | Description |
---|---|
bool | Returns true if automatic dynamic resolution scaling is supported, and returns false if it is not. |
OnInstanceCreate(ulong)
Called after xrCreateInstance
. Override this method to validate that any necessary OpenXR extensions were
successfully enabled (OpenXRRuntime.IsExtensionEnabled)
and that any required system properties are supported. If this method returns false,
the feature's enabled property is set to false.
Declaration
protected override bool OnInstanceCreate(ulong instance)
Parameters
Type | Name | Description |
---|---|---|
ulong | instance |
Returns
Type | Description |
---|---|
bool | true if this feature successfully initialized. Otherwise, false. |
Overrides
Remarks
If this feature is a required feature of an enabled feature set, returning false here
causes the OpenXRLoader
to fail, and XR Plug-in Management will fall back to another loader if enabled.
See Also
SetUsingSuggestedResolutionScale(bool)
Set whether or not we are using the suggested resolution provided by the extensions, rather than disregarding it and not updating resolution automatically. Default is true.
Declaration
public static void SetUsingSuggestedResolutionScale(bool usingSuggestedScale)
Parameters
Type | Name | Description |
---|---|---|
bool | usingSuggestedScale | The flag whether or not to use the suggested resolution and update the resolution automatically. |