namespace UnityEngine.Rendering
{
///
/// XR Utility class.
///
public static class XRUtils
{
///
/// Draw the XR occlusion mesh.
///
/// Command Buffer used to draw the occlusion mesh.
/// Camera for which the occlusion mesh is rendered.
/// True if stereo rendering is enabled.
public static void DrawOcclusionMesh(CommandBuffer cmd, Camera camera, bool stereoEnabled = true) // Optional stereoEnabled is for SRP-specific stereo logic
{
if ((!XRGraphics.enabled) || (!camera.stereoEnabled) || (!stereoEnabled))
return;
UnityEngine.RectInt normalizedCamViewport = new UnityEngine.RectInt(0, 0, camera.pixelWidth, camera.pixelHeight);
cmd.DrawOcclusionMesh(normalizedCamViewport);
}
}
}