Class XRBuiltinShaderConstants
Helper static class used by render pipelines to setup stereo constants accessed by builtin shaders.
Inherited Members
Namespace: UnityEngine.Experimental.Rendering
Assembly: Unity.RenderPipelines.Core.Runtime.dll
Syntax
public static class XRBuiltinShaderConstants
Fields
unity_StereoCameraInvProjection
Cached unique id for unity_StereoCameraInvProjection
Declaration
public static readonly int unity_StereoCameraInvProjection
Field Value
Type | Description |
---|---|
int |
unity_StereoCameraProjection
Cached unique id for unity_StereoCameraProjection
Declaration
public static readonly int unity_StereoCameraProjection
Field Value
Type | Description |
---|---|
int |
unity_StereoMatrixInvP
Cached unique id for unity_StereoMatrixInvP
Declaration
public static readonly int unity_StereoMatrixInvP
Field Value
Type | Description |
---|---|
int |
unity_StereoMatrixInvV
Cached unique id for unity_StereoMatrixInvV
Declaration
public static readonly int unity_StereoMatrixInvV
Field Value
Type | Description |
---|---|
int |
unity_StereoMatrixInvVP
Cached unique id for unity_StereoMatrixInvVP
Declaration
public static readonly int unity_StereoMatrixInvVP
Field Value
Type | Description |
---|---|
int |
unity_StereoMatrixP
Cached unique id for unity_StereoMatrixP
Declaration
public static readonly int unity_StereoMatrixP
Field Value
Type | Description |
---|---|
int |
unity_StereoMatrixV
Cached unique id for unity_StereoMatrixV
Declaration
public static readonly int unity_StereoMatrixV
Field Value
Type | Description |
---|---|
int |
unity_StereoMatrixVP
Cached unique id for unity_StereoMatrixVP
Declaration
public static readonly int unity_StereoMatrixVP
Field Value
Type | Description |
---|---|
int |
unity_StereoWorldSpaceCameraPos
Cached unique id for unity_StereoWorldSpaceCameraPos
Declaration
public static readonly int unity_StereoWorldSpaceCameraPos
Field Value
Type | Description |
---|---|
int |
Methods
SetBuiltinShaderConstants(RasterCommandBuffer)
Bind the shader constants used by the C++ builtin renderer via a raster command buffer. UpdateBuiltinShaderConstants
should be called before to update the constants.
This is required to maintain compatibility with legacy code and shaders.
Declaration
public static void SetBuiltinShaderConstants(RasterCommandBuffer cmd)
Parameters
Type | Name | Description |
---|---|---|
RasterCommandBuffer | cmd |
SetBuiltinShaderConstants(CommandBuffer)
Bind the shader constants used by the C++ builtin renderer via a command buffer. UpdateBuiltinShaderConstants
should be called before to update the constants.
This is required to maintain compatibility with legacy code and shaders.
Declaration
public static void SetBuiltinShaderConstants(CommandBuffer cmd)
Parameters
Type | Name | Description |
---|---|---|
CommandBuffer | cmd |
Update(XRPass, CommandBuffer, bool)
Update and bind shader constants used by the C++ builtin renderer given the XRPass. For better control of setting up builtin shader constants, see UpdateBuiltinShaderConstants
and SetBuiltinShaderConstants
which do the same logic but could take in custom projection and view matricies instead.
This is required to maintain compatibility with legacy code and shaders.
Declaration
public static void Update(XRPass xrPass, CommandBuffer cmd, bool renderIntoTexture)
Parameters
Type | Name | Description |
---|---|---|
XRPass | xrPass | |
CommandBuffer | cmd | |
bool | renderIntoTexture |
UpdateBuiltinShaderConstants(Matrix4x4, Matrix4x4, bool, int)
Update the shader constant data used by the C++ builtin renderer.
Declaration
public static void UpdateBuiltinShaderConstants(Matrix4x4 viewMatrix, Matrix4x4 projMatrix, bool renderIntoTexture, int viewIndex)
Parameters
Type | Name | Description |
---|---|---|
Matrix4x4 | viewMatrix | |
Matrix4x4 | projMatrix | |
bool | renderIntoTexture | |
int | viewIndex |