Class XRSystem
Used by render pipelines to communicate with XR SDK.
Namespace: UnityEngine.Experimental.Rendering
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 |
---|---|
Boolean |
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 |
---|---|
Boolean |
foveatedRenderingCaps
Cached value of SystemInfo.foveatedRenderingCaps.
Declaration
public static FoveatedRenderingCaps foveatedRenderingCaps { get; set; }
Property Value
Type | Description |
---|---|
UnityEngine.Rendering.FoveatedRenderingCaps |
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 |
---|---|
Boolean |
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()
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 | |
UnityEngine.Shader | occlusionMeshPS | |
UnityEngine.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 |
---|---|---|
UnityEngine.Rendering.CommandBuffer | cmd | |
UnityEngine.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(Single)
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 |
---|---|---|
Single | renderScale | A value of 1.0f represents 100% of the original resolution. |