Search Unity

Question How to capture screenshot from (flatscreen) gameview and not VR?

Discussion in 'AR/VR (XR) Discussion' started by jashan, Sep 14, 2020.

  1. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    ScreenCapture.CaptureScreenshot(...) used to capture screenshots from the gameview. Unfortunately, at some point, this was changed and now that method captures screenshots from the in-headset VR view. While there are obvious usecases for the latter, this is completely useless in our project. We need to see exactly what's in the gameview (including gameview UIs, and spectator cameras that render from different perspectives).

    There is one overload CaptureScreenshot(string filename, ScreenCapture.StereoScreenCaptureMode stereoCaptureMode); - which looks useful at first sight, until one has a look at StereoScreenCaptureMode, which only lets us select left, right or both - but not none, which is what I need (I don't quite get why a new enum has been added instead of using StereoTargetEyeMask).

    So, is there a way to achieve this again?
     
  2. petak_core

    petak_core

    Joined:
    Nov 19, 2012
    Posts:
    57
    Hello, @jashan I'm facing the same issue.

    In VR I use ScreenCapture.CaptureScreenshot(...) I can save only as Left Eye / Right Eye or Both Eyes, but all of these screenshots are bad, Left Eye is moved to the left side, Right Eye is moved to the right, and both just both eye. I just want to get a "flat" screenshot. Which I can get only if I don't use VR headset.

    I tried use Texture2D.ReadPixels method from this post, but there is an issue in VR, everything is so much blur. And of course I turn off the Motion Blur effect in my Volume on Camera.

    Have you found a fine/workaround solution?
     
  3. tenconmar

    tenconmar

    Joined:
    Mar 15, 2021
    Posts:
    29
    Look into using the Unity Recorder, Its very good. Create a second camera in the scene and set the Unity recorder Input camera to the non VR camera you created.