Class XRSystem
Used by render pipelines to communicate with XR SDK.
Inherited Members
Namespace: UnityEngine.Experimental.Rendering
Assembly: Unity.RenderPipelines.Core.Runtime.dll
Syntax
public static class XRSystem
Fields
emptyPass
Valid empty pass when a camera is not using XR.
Declaration
public static readonly XRPass emptyPass
Field Value
Type | Description |
---|---|
XRPass |
Properties
displayActive
Returns true if a XR device is connected and running.
Declaration
public static bool displayActive { get; }
Property Value
Type | Description |
---|---|
bool |
dumpDebugInfo
If true, the system will log some information about the layout to the console.
Declaration
public static bool dumpDebugInfo { get; set; }
Property Value
Type | Description |
---|---|
bool |
foveatedRenderingCaps
Cached value of SystemInfo.foveatedRenderingCaps.
Declaration
public static FoveatedRenderingCaps foveatedRenderingCaps { get; set; }
Property Value
Type | Description |
---|---|
FoveatedRenderingCaps |
isHDRDisplayOutputActive
Returns if the XR display is running in HDR mode.
Declaration
public static bool isHDRDisplayOutputActive { get; }
Property Value
Type | Description |
---|---|
bool |
singlePassAllowed
If true, the system will try to create a layout compatible with single-pass rendering.
Declaration
public static bool singlePassAllowed { get; set; }
Property Value
Type | Description |
---|---|
bool |
Methods
Dispose()
Free up resources used by the system.
Declaration
public static void Dispose()
EndLayout()
Used by the render pipeline to complete the XR layout at the end of the frame.
Declaration
public static void EndLayout()
GetActiveDisplay()
Returns the active XR display.
Declaration
public static XRDisplaySubsystem GetActiveDisplay()
Returns
Type | Description |
---|---|
XRDisplaySubsystem |
GetDisplayMSAASamples()
Returns the number of samples (MSAA) currently configured on the XR device.
Declaration
public static MSAASamples GetDisplayMSAASamples()
Returns
Type | Description |
---|---|
MSAASamples |
Initialize(Func<XRPassCreateInfo, XRPass>, Shader, Shader)
Use this method to assign the shaders that will be used to render occlusion mesh for each XRPass and the final mirror view.
Declaration
public static void Initialize(Func<XRPassCreateInfo, XRPass> passAllocator, Shader occlusionMeshPS, Shader mirrorViewPS)
Parameters
Type | Name | Description |
---|---|---|
Func<XRPassCreateInfo, XRPass> | passAllocator | |
Shader | occlusionMeshPS | |
Shader | mirrorViewPS |
NewLayout()
Used by the render pipeline to initiate a new rendering frame through a XR layout.
Declaration
public static XRLayout NewLayout()
Returns
Type | Description |
---|---|
XRLayout |
RenderMirrorView(CommandBuffer, Camera)
Used by the render pipeline to render the mirror view to the gameview, as configured by the XR device.
Declaration
public static void RenderMirrorView(CommandBuffer cmd, Camera camera)
Parameters
Type | Name | Description |
---|---|---|
CommandBuffer | cmd | |
Camera | camera |
SetDisplayMSAASamples(MSAASamples)
Used by the render pipeline to communicate to the XR device how many samples are used by MSAA.
Declaration
public static void SetDisplayMSAASamples(MSAASamples msaaSamples)
Parameters
Type | Name | Description |
---|---|---|
MSAASamples | msaaSamples |
SetRenderScale(float)
Used by the render pipeline to scale the render target on the XR device.
Declaration
public static void SetRenderScale(float renderScale)
Parameters
Type | Name | Description |
---|---|---|
float | renderScale | A value of 1.0f represents 100% of the original resolution. |