Search Unity

Question Getting the current stereo eye in a RenderPass/Shader

Discussion in 'Universal Render Pipeline' started by Pepn, Mar 2, 2023.

  1. Pepn

    Pepn

    Joined:
    Sep 27, 2017
    Posts:
    9
    Hi,

    For a project using Google cardboard XR are we trying to render different images to the left and right eye.

    When I run
    Camera.main.stereoEnabled
    it returns true on Android.
    However, when I use the EyeIndexNode in shadergraph it always returns 0.

    So I wanted to check what Camera.main.stereoActiveEye is active, however, this always returns "mono" indicating that stereo is disabled, this does not make sense?

    I tried to test this stereoActiveEye function during a rendercallback but was unsure how to do this in a RenderFeature, as this is required in the scriptablerenderpipeline.

    Using unity 2022.2.5 with URP.

    Thanks in advance!