// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using Microsoft.MixedReality.Toolkit.CameraSystem;
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.WindowsMixedReality
{
///
/// Configuration profile for the Windows Mixed Reality camera settings provider.
///
[CreateAssetMenu(menuName = "Mixed Reality/Toolkit/Providers/Windows Mixed Reality/Windows Mixed Reality Camera Settings Profile", fileName = "WindowsMixedRealityCameraSettingsProfile", order = 100)]
[MixedRealityServiceProfile(typeof(BaseWindowsMixedRealityCameraSettings))]
public class WindowsMixedRealityCameraSettingsProfile : BaseCameraSettingsProfile
{
[SerializeField]
[Tooltip("If enabled, will render scene from PV camera projection matrix while MRC is active. This will ensure that holograms, such as hand meshes, remain visibly aligned in the video output.")]
private bool renderFromPVCameraForMixedRealityCapture = false;
///
/// Whether to use photo/video camera rendering for Mixed Reality Capture on Windows.
///
///
/// If true, the platform will provide an additional HolographicCamera to the app when a mixed reality capture photo or video is taken.
/// This HolographicCamera provides view matrices corresponding to the photo/video camera location, and it provides projection matrices using the photo/video camera field of view.
///
public bool RenderFromPVCameraForMixedRealityCapture => renderFromPVCameraForMixedRealityCapture;
[SerializeField]
[Tooltip("Specifies the default reprojection method for HoloLens 2. Note: AutoPlanar requires the DotNetWinRT adapter. DepthReprojection is the default if the adapter isn't present.")]
private HolographicDepthReprojectionMethod reprojectionMethod = HolographicDepthReprojectionMethod.DepthReprojection;
///
/// Specifies the default reprojection method for HoloLens 2.
///
/// AutoPlanar requires the DotNetWinRT adapter. DepthReprojection is the default if the adapter isn't present.
public HolographicDepthReprojectionMethod ReprojectionMethod => reprojectionMethod;
[SerializeField]
[Tooltip("Override the camera's projection matrices for a smaller field of view, but rendered content will have more detail.")]
private bool readingModeEnabled = false;
///
/// Override the camera's projection matrices for a smaller field of view,
/// but rendered content will have more detail. See Reading Mode documentation.
/// While this will work on all Windows Mixed Reality platforms, this
/// is primarily useful on HoloLens 2 hardware.
/// If holograms are not stable, change the Stereo Rendering Mode from
/// "Single Pass Instanced" to "Multi Pass" to work around a bug in Unity.
///
public bool ReadingModeEnabled => readingModeEnabled;
}
}