Search Unity

Question Stereo Instancing doesn't respect Stereo Target Eye when rendering to a RenderTexture (Custom SRP)

Discussion in 'General Graphics' started by equalsequals, Nov 10, 2021.

  1. equalsequals

    equalsequals

    Joined:
    Sep 27, 2010
    Posts:
    154
    Hi, I'm hoping someone can shed some light on what I am doing wrong.

    I am trying to support Stereo Instancing in a (minimalist) custom SRP, and I am coming up against an issue when I attempt to target anything other than the device Eye Textures (e.g 'XR Texture [x]').

    If I render to the Eye Textures directly, everything works fine and each instance is rendered to its respective Target Eye. In the case where I target a RenderTexture, both instances are rendered to the Left Eye Only (Slice 0).

    After viewing both cases in RenderDoc and comparing, I see no discernable difference between the Draw Calls themselves, the RenderTargets, nor the outputs from the Vertex Shaders.

    Working (Eye Textures):


    Not working (RenderTexture):


    I am looking at URP as a reference but am finding it hard to parse out the relevant snippets.

    I can provide more info and screen shots if someone would be willing to look at this with me.

    Thanks in advance.