Class UniversalRenderPipelineRuntimeXRResources
A resource container for textures used for Universal
Inherited Members
Namespace: UnityEngine .Rendering.Universal
Assembly: Unity.RenderPipelines.Universal.Runtime.dll
Syntax
[Serializable]
[SupportedOnRenderPipeline(typeof(UniversalRenderPipelineAsset))]
[CategoryInfo(Name = "R: Runtime XR", Order = 1000)]
[HideInInspector]
public class UniversalRenderPipelineRuntimeXRResources : IRenderPipelineResources, IRenderPipelineGraphicsSettings
Remarks
You cannot edit these resources through the editor's UI; use the API for advanced changes. Changing this through the API is only allowed in the Editor. In the Player, this raises an error.
This container is removed for non-XR builds.
Examples
Here is an example of how to get the MotionVector shader used by URP for XR.
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
public static class URPUniversalRendererRuntimeXRResourcesHelper
{
public static Shader motionVector
{
get
{
var gs = GraphicsSettings.GetRenderPipelineSettings<UniversalRenderPipelineRuntimeXRResources>();
if (gs == null) //not in URP or XR not enabled
return null;
return gs.xrMotionVector;
}
}
}
Properties
version
Current version of the resource container. Used only for upgrading a project.
Declaration
public int version { get; }
Property Value
Type | Description |
---|---|
int |
See Also
xrMirrorViewPS
XR Mirror View shader.
Declaration
public Shader xrMirrorViewPS { get; set; }
Property Value
Type | Description |
---|---|
Shader |
See Also
xrMotionVector
XR MotionVector shader.
Declaration
public Shader xrMotionVector { get; set; }
Property Value
Type | Description |
---|---|
Shader |
See Also
xrOcclusionMeshPS
XR Occlusion mesh shader.
Declaration
public Shader xrOcclusionMeshPS { get; set; }
Property Value
Type | Description |
---|---|
Shader |