Search Unity

(Vive) Single Pass Rendering not working with assetbundles

Discussion in 'AR/VR (XR) Discussion' started by Jribs, May 23, 2018.

  1. Jribs

    Jribs

    Joined:
    Jun 10, 2014
    Posts:
    154
    Hi,

    Was wondering if anyone else had this problem. When I try to use single pass rendering I can see it working normally on my initial scene of my project, but once I load a scene that comes from a downloaded assetbundle, the single pass rendering then stops working. You can see the different eyes do not line up properly.

    Any ideas? I'm stuck using multi pass as it is now.
     
  2. scvnathan

    scvnathan

    Joined:
    Apr 29, 2016
    Posts:
    75
    Dang, I'm running into the same problem :( Are you still stuck?
     
  3. Jribs

    Jribs

    Joined:
    Jun 10, 2014
    Posts:
    154
  4. scvnathan

    scvnathan

    Joined:
    Apr 29, 2016
    Posts:
    75
    So I was able to fix it for our scenario. Maybe it's the same for you @Jribs. Basically we have a separate project where we build the AssetBundle. What we had to do was have that other project have the same VR settings as our main game's project. I thought the main game's player settings would override whats in the AssetBundle but I guess not.
     
  5. sr3ds

    sr3ds

    Joined:
    Apr 29, 2015
    Posts:
    5
    @scvnathan can you explain exactly which settings need to be the same? I´m running into the same problem at the moment, and i got it already between multiple different versions in different projects? What exactly need to match?

    Thanks a lot!
     
  6. scvnathan

    scvnathan

    Joined:
    Apr 29, 2016
    Posts:
    75
    I'll have to check once I get into work but I believe I just needed VR (along with single pass selected) and linear color space to be enabled in both projects.
     
  7. Jribs

    Jribs

    Joined:
    Jun 10, 2014
    Posts:
    154
    Yes this was my problem as well. We have 2 different builds in the same project, one that has XR enabled and one that doesn't. If you want the assetbundles to work you need to have XR enabled to build them and have them work.

    I found assetbundles built with XR enabled work for non XR projects, but not the other way around.
     
  8. Nigey

    Nigey

    Joined:
    Sep 29, 2013
    Posts:
    1,129
    Can you confirm that's still the case now? I'm creating my asset bundles with XR settings enabled, with single pass rendering enabled, and in VR it is working. When using monitor however it splits the camera in two as if it's XR enabled, when I'm confirming it's not via:

    Code (CSharp):
    1. public class IsXREnabled : MonoBehaviour
    2. {
    3.     // Start is called before the first frame update
    4.     void Awake()
    5.     {
    6.         DontDestroyOnLoad(gameObject);
    7.     }
    8.  
    9.     // Update is called once per frame
    10.     void Update()
    11.     {
    12.         Debug.Log(XRSettings.enabled);
    13.     }
    14. }
    15.  
     
  9. Narmer

    Narmer

    Joined:
    Mar 5, 2014
    Posts:
    25
    Thank you so much! It helped.
     
  10. not_a_valid_username

    not_a_valid_username

    Joined:
    Jul 28, 2018
    Posts:
    23
    Just had this issue as well, for me it required that both the assetbundle creator and consumer have XR enabled with single pass on. Thanks for the help scvnathan!
     
  11. zetingq

    zetingq

    Joined:
    Dec 8, 2016
    Posts:
    26
    Thank you very much for this post, I encountered the same problem and it has been resolved