Class MetaTemporalPixelSynthesisFeature
Enables the XR_META_temporal_pixel_synthesis OpenXR extension.
This feature allows applications to provide per-view motion vector, depth, and stencil data so that the Meta runtime can apply temporal anti-aliasing, upscaling, or other temporal reconstruction techniques to improve the visual quality of the current frame's projection layer content.
Enable this feature in Project Settings > XR Plug-in Management > OpenXR > OpenXR Feature Groups. Call SetPixelSynthesis(in PixelSynthesisFrameParams) to supply parameters; values are cached and reused every frame until updated. Default parameters are applied automatically when the session starts if SetPixelSynthesis(in PixelSynthesisFrameParams) has not been called.
Inherited Members
Namespace: UnityEngine.XR.OpenXR.Features.Meta
Assembly: Unity.XR.OpenXR.dll
Syntax
public class MetaTemporalPixelSynthesisFeature : OpenXRFeature
Fields
ExtensionString
The OpenXR extension string required by this feature.
Declaration
public const string ExtensionString = "XR_META_temporal_pixel_synthesis"
Field Value
| Type | Description |
|---|---|
| string |
FeatureId
The unique feature ID used to identify this feature in OpenXR settings.
Declaration
public const string FeatureId = "com.unity.openxr.feature.meta.temporalpixelsynthesis"
Field Value
| Type | Description |
|---|---|
| string |
defaultEnableUpscaling
Default setting for whether upscaling is requested.
Declaration
[Tooltip("Let the device upscale the rendered image. Requires a device that supports upscaling.")]
public bool defaultEnableUpscaling
Field Value
| Type | Description |
|---|---|
| bool |
defaultFoveaQuality
Quality requested for the fovea (central) region, applied when SetPixelSynthesis(in PixelSynthesisFrameParams) is called without an explicit override.
Declaration
[Tooltip("Quality requested for the fovea (central) region of the image. The device may adjust this based on available performance.")]
public PixelSynthesisQualityLevel defaultFoveaQuality
Field Value
| Type | Description |
|---|---|
| PixelSynthesisQualityLevel |
defaultFoveaRadius
Size of the fovea region, controlling where the central region ends and the periphery begins.
Declaration
[Tooltip("Size of the fovea region, controlling where the central region ends and the periphery begins. A larger fovea favors quality, a smaller one favors performance.")]
public PixelSynthesisFoveaRadius defaultFoveaRadius
Field Value
| Type | Description |
|---|---|
| PixelSynthesisFoveaRadius |
defaultPeripheryQuality
Quality requested for the periphery (outer) region, applied when SetPixelSynthesis(in PixelSynthesisFrameParams) is called without an explicit override.
Declaration
[Tooltip("Quality requested for the periphery (outer) region of the image. The device may adjust this based on available performance.")]
public PixelSynthesisQualityLevel defaultPeripheryQuality
Field Value
| Type | Description |
|---|---|
| PixelSynthesisQualityLevel |
defaultUpscalingQuality
Quality requested for upscaling. Only used when defaultEnableUpscaling is true.
Declaration
[Tooltip("Quality requested when upscaling. The device may adjust this based on available performance.")]
public PixelSynthesisQualityLevel defaultUpscalingQuality
Field Value
| Type | Description |
|---|---|
| PixelSynthesisQualityLevel |
Properties
Instance
Singleton accessor. Returns null when the feature is not enabled.
Declaration
public static MetaTemporalPixelSynthesisFeature Instance { get; }
Property Value
| Type | Description |
|---|---|
| MetaTemporalPixelSynthesisFeature |
IsSupported
Whether the device runtime reports support for this extension. Populated after session creation.
Declaration
public bool IsSupported { get; }
Property Value
| Type | Description |
|---|---|
| bool |
RecommendedMotionVectorHeight
The recommended motion-vector image height (pixels) for the first view.
Declaration
public uint RecommendedMotionVectorHeight { get; }
Property Value
| Type | Description |
|---|---|
| uint |
RecommendedMotionVectorWidth
The recommended motion-vector image width (pixels) for the first view,
queried from XrViewPixelSynthesisConfigurationViewMETA. Zero until
OnSessionCreate(ulong) runs.
Declaration
public uint RecommendedMotionVectorWidth { get; }
Property Value
| Type | Description |
|---|---|
| uint |
SupportedFeatureFlags
Bitmask of optional features reported by the runtime via
XrSystemPixelSynthesisPropertiesMETA.supportedFeatureFlags.
Declaration
public PixelSynthesisSupportedFeatureFlags SupportedFeatureFlags { get; }
Property Value
| Type | Description |
|---|---|
| PixelSynthesisSupportedFeatureFlags |
Methods
ClearPixelSynthesis()
Resets pixel synthesis parameters to their defaults. Pixel synthesis remains active; use SetPixelSynthesisEnabled(bool) to enable or disable it.
Declaration
public static void ClearPixelSynthesis()
GetValidationChecks(List<ValidationRule>, BuildTargetGroup)
Allows a feature to add to a list of validation rules which your feature will evaluate at build time. Details of the validation results can be found in OpenXRProjectValidation.
Declaration
protected override void GetValidationChecks(List<OpenXRFeature.ValidationRule> rules, BuildTargetGroup targetGroup)
Parameters
| Type | Name | Description |
|---|---|---|
| List<OpenXRFeature.ValidationRule> | rules | Your feature will check the rules in this list at build time. Add rules that you want your feature to check, and remove rules that you want your feature to ignore. |
| BuildTargetGroup | targetGroup | Build target group these validation rules will be evaluated for. |
Overrides
HookGetInstanceProcAddr(IntPtr)
Called to hook xrGetInstanceProcAddr. Returning a different function pointer allows intercepting any OpenXR method.
Declaration
protected override IntPtr HookGetInstanceProcAddr(IntPtr func)
Parameters
| Type | Name | Description |
|---|---|---|
| IntPtr | func | xrGetInstanceProcAddr native function pointer |
Returns
| Type | Description |
|---|---|
| IntPtr | Function pointer that Unity will use to look up OpenXR native functions. |
Overrides
OnDisable()
Called when the object is loaded.
Declaration
protected override void OnDisable()
Overrides
Remarks
Additional information: ScriptableObject.OnDisable
OnEnable()
Called when the object is loaded.
Declaration
protected override void OnEnable()
Overrides
Remarks
Additional information: ScriptableObject.OnEnable
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 xrInstance)
Parameters
| Type | Name | Description |
|---|---|---|
| ulong | xrInstance | Handle of the native |
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
OnInstanceDestroy(ulong)
Called before xrDestroyInstance
Declaration
protected override void OnInstanceDestroy(ulong xrInstance)
Parameters
| Type | Name | Description |
|---|---|---|
| ulong | xrInstance | Handle of the xrInstance |
Overrides
OnSessionCreate(ulong)
Called after xrCreateSession.
Declaration
protected override void OnSessionCreate(ulong xrSession)
Parameters
| Type | Name | Description |
|---|---|---|
| ulong | xrSession | Handle of the xrSession |
Overrides
OnSessionDestroy(ulong)
Called before xrDestroySession.
Declaration
protected override void OnSessionDestroy(ulong xrSession)
Parameters
| Type | Name | Description |
|---|---|---|
| ulong | xrSession | Handle of the xrSession |
Overrides
SetPixelSynthesis(in PixelSynthesisFrameParams)
Configures pixel synthesis parameters. Values are cached and reused every frame
until this method is called again. Call before xrEndFrame is submitted
(typically in a camera callback or just before XRDisplaySubsystem.Stop()).
Declaration
public static void SetPixelSynthesis(in PixelSynthesisFrameParams @params)
Parameters
| Type | Name | Description |
|---|---|---|
| PixelSynthesisFrameParams | params | Pixel synthesis parameters to apply. |
SetPixelSynthesisEnabled(bool)
Enables or disables pixel synthesis at runtime without discarding the cached parameters. When re-enabled, the previously cached parameters resume immediately.
Declaration
public static void SetPixelSynthesisEnabled(bool enabled)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | enabled |
|