Cameras

There are 4 cameras in the JMRMixedReality prefab.

Rendering from cameras

The head camera renders the application in 2d mono view in the unity editor.

Left and right cameras render the application in 3d stereo view on the target device.

POV camera is used for casting your application to other devices.

Mono View - Covers the entire screen - Usually rendered by the main *head* camera in unity editor.
Stereo View - Split into two views - Rendered by the *left* and *right* cameras.

Skybox

Skybox can be used to render the sky. Skybox has other use cases as well as mentioned in unity's documentation.

In the unity editor skybox is enabled by default.

Skybox is enabled by default in VR devices i.e., JioDive

Skybox is disabled by default in AR devices i.e., JioPrism and JioGlass.

Virtual Controller has the functionality to turn the skybox on and off by changing the camera Clear Flags.

Forcing skybox mode in your application

You can force the cameras to render in skybox mode by changing the camera clear flags on the OnEnable event after 1-2 frames delay.

Users can still revert to Clear flags - Solid Color by toggling VR mode in Virtual Controller.

public class SkyboxAddition: MonoBehaviour
{
    Camera head, left, right;

    private void Awake()
    {
        head = JMRRigManager.Instance.transform.Find("JMRRenderer/Head")?.GetComponent<Camera>();
        left = JMRRigManager.Instance.transform.Find("JMRRenderer/Head/Left")?.GetComponent<Camera>();
        right = JMRRigManager.Instance.transform.Find("JMRRenderer/Head/Right")?.GetComponent<Camera>();
    }

    private void OnEnable()
    {
        StartCoroutine(AddSkybox());
    }

    IEnumerator AddSkybox()
    {
        for (int i = 0; i < 2; i++) yield return null;
        head.clearFlags = left.clearFlags = right.clearFlags = CameraClearFlags.Skybox;
    }
}

Last updated