Search Unity

Tiny camera preview sitting in the inspector. Please go away! (LRP and Oculus - 2018.2.1f1)

Discussion in 'AR/VR (XR) Discussion' started by grahamwell, Jul 29, 2018.

  1. grahamwell

    grahamwell

    Joined:
    Oct 5, 2013
    Posts:
    6
    This might be a simple switch which I can't find.

    Every time I run the game in the Editor, if there's an object selected which includes a material, a tiny little 1cm x 1cm camera preview window appears at the bottom left of the inspector. It's too small to be of any use and it's accompanied by a blizzard of errors:
    Cannot change renderViewportScale while cameras are rendering!
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)​
    As you might imagine this cripples Editor performance.

    Workaround is simple. Just select something which doesn't have a material associated with it. So I do that, but it is annoying.

    Been happening since 2018.1 when using the Lightweight Render Pipeline and with Oculus support installed, VR support switched on (even if no VR cameras in the scene)

    Can I make this go away?

    Thanks
     
  2. CTvilgalys

    CTvilgalys

    Joined:
    Mar 28, 2017
    Posts:
    2
    Did you ever find a solution to this? Happening on our project as well.
     
  3. NickStevensIXR

    NickStevensIXR

    Joined:
    Nov 17, 2017
    Posts:
    1
    For me, this seemed to be resolved by going to the IsStereoEnabled(Camera camera) function at the bottom of LightweightPipelineCore.cs, and also adding a check for 'camera.cameraType != CameraType.Preview'.

    Another bug where the material preview would render as stereo, showing two primitives, was fixed by this as well.

    If you haven't replaced the lightweight pipeline with your own version, the file should be located at C:\Users\[Your User]\AppData\Local\Unity\cache\packages\packages.unity.com\com.unity.render-pipelines.lightweight@3.0.0-preview\LWRP\LightweightPipelineCore.cs