I'm trying to achieve a mirror effect where a second camera renders to a render texture, which is then passed into a shader using SetGlobalTexture.

Everything works fine outside of VR, but in Steam VR it seems like the render texture only stores the texture for one eye (left), even with single-pass stereo enabled in player settings.

How can I access the texture for the second eye? Or rather, how can I access the texture where both eyes have been drawn, one on each half of the screen?

What I'm doing at the moment:

void Awake()
    mirrorCameraRenderTexture = new RenderTexture(vrCam.pixelWidth, vrCam.pixelHeight, 24);
    mirrorCamera.targetTexture = mirrorCameraRenderTexture;

    Shader.SetGlobalTexture("_MirrorCameraRenderTexture", mirrorCameraRenderTexture);
  • \$\begingroup\$ By "Stores the texture for one eye" do you mean that it uses the same texture for both eyes, or is it Black / Blank in one eye? \$\endgroup\$ – Zebraman Jun 16 '17 at 14:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.