Search Unity

extreme hign draw calls VR camera Oculus

Discussion in 'AR/VR (XR) Discussion' started by RHoogland, Mar 28, 2015.

  1. RHoogland

    RHoogland

    Joined:
    Jan 24, 2015
    Posts:
    30
    When I replace the normal camera in my scene by the VR camera, my draw calls increase by roughly a factor 10. (with the normal camera I have around 4500 draw calls, with the VR camera around 45 000).
    My suspicion is that the occlusion does not work properly with the VR camera, although the occlusion checkbox in the VR camera is activated.

    Can anyone give me some advice on that ?

    Thanks,
     
    Last edited: Mar 30, 2015
  2. scottb9239

    scottb9239

    Joined:
    Jan 5, 2013
    Posts:
    107
    I feel that I am having the same problem. I am working on two seperate Gear VR projects and have noticed that neither seems to be using the occlusion culling once built onto the Note 4/Gear VR. The occlusion culling works fine in the editor however, very concerning.

    The reason I am able to verify this is that I have a large cube that is using an invisible shader but is set to occluder. In the editor the invisible cube stops other objects being drawn behind it, as you would expect. On the Gear VR all of the objects are being drawn and I have multiple times the amount of draw calls compared to the editor (260 draw calls compared to 50).

    If you find a fix please update this thread.
     
  3. RHoogland

    RHoogland

    Joined:
    Jan 24, 2015
    Posts:
    30
    When I delete the VR camera and put back the normal camera, it also ignores occlusion. I then have to exit Unity and re-enter it for having the normal camera work well with occlusion again.
    I suspect that when deleting a camera, some of it remains "lying around" in the background of the system, thus disturbing the occlusion process. Could be a file that is not deleted properly or something like that.
    If any experts are reading this, please help.
     
  4. scottb9239

    scottb9239

    Joined:
    Jan 5, 2013
    Posts:
    107
    Interesting, I really hope this get fixed soon as occlusion culling for Gear VR development is the main reason I bought Unity Pro/Android Pro, might have to request a refund if this doesn't get fixed soon as I have to ship this product in a few weeks.
     
    vicator likes this.
  5. JDMulti

    JDMulti

    Joined:
    Jan 4, 2012
    Posts:
    384
    Sounds bad, looks like occlusion culling is broken. I had it working in 4.6.2 tho, used a huge environment and had drawcalls increase from 800 to 1800 with OVR Controller, sounds reasonable but not your project.

    However I found out that when you have an OVRController and your pc is not even using 100% of it's resources ( cpu and GPU ) the VR experience can stutter a lot and render at a lower fps. It seams the VR solution currently in Unity is not optimized at all. So far I haven't seen a single respons on that issue I had a month ago and still have.
     
  6. scottb9239

    scottb9239

    Joined:
    Jan 5, 2013
    Posts:
    107
    I did some further testing with a new test scene last night. Had a large glass cube with with a sphere just next to each side, four in total and a floor. Running it as an Android build (non-VR) the occlusion culling seemed to work great, so not just an Android issue.

    But when running it on Gear VR the occlusion culling does work a little I noticed, the spheres flickered on and off but were for the most part not culling 80-90% of the time compared to the non-VR build. If you turn off the occlusion culling flags on both VR cameras in the OVR rig the spheres always remain, so it is trying to cull, it just fails most of the time.
     
  7. sisermann

    sisermann

    Joined:
    Jun 27, 2013
    Posts:
    25
    I am just guessing but can you not attach a normal camera to the oculus camera so that you trick unity to use occlusion culling ? I am also very concerned by this, this is a terrible bug.
     
  8. scottb9239

    scottb9239

    Joined:
    Jan 5, 2013
    Posts:
    107
    Hi sisermann, I don't think that would work sadly, but I will surely try it (I did try copying all attributes from a new camera to both left and right OVR cameras with no luck unfortunately). I think something in the OVR scripts attached to the cameras is messing up the raycast to detect occlusion culling properly, thus rendering it pretty much useless.

    You can see it is doing "something" as the behind objects will flicker off here and there, but it really is like 1-5% of the gain over time that a properly functioning occlusion culling setup would get you.
     
  9. sayangel

    sayangel

    Joined:
    Apr 11, 2014
    Posts:
    12
    Any updates on this? I've been noticing the occlusion doesn't work as expected when I run a scene on the GearVR.

    Would appreciate any advice.
     
  10. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Bugs reported on forum almost never get fixed vs bugs reported with with a demonstration project via bug reporter. The latter will get fixed really fast.
     
  11. scottb9239

    scottb9239

    Joined:
    Jan 5, 2013
    Posts:
    107
    I have already submitted a bug with demonstration project to both Unity's bug reporter and Oculus support several weeks ago.
     
  12. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    OK if it's still not closed on fogbugz then likely they're working on it.
     
  13. JDMulti

    JDMulti

    Joined:
    Jan 4, 2012
    Posts:
    384
    Not really, I've posted a couple of bugs before and only 1 got fixed so far and also was posted on the forum. That was also the only one I got an email from. So if you didn't receive an email, they might have put it on low priority, but I hope not since it's quite serious.
     
  14. Cratesmith

    Cratesmith

    Joined:
    Aug 14, 2011
    Posts:
    137
    I had occlusion culling working on the gear vr in my project... and then it just stopped working.
    For my project this is incredibly frustrating, if it had been consistently not working then it would have been possible to design around it not being there... as it stands a huge amount of content needs to be edited or remade before the deadline on monday.
     
  15. scottb9239

    scottb9239

    Joined:
    Jan 5, 2013
    Posts:
    107
    Yes, it is frustrating, I have two projects relying on getting as much performance out of Unity as possible. I ended up having to refund my Unity Pro and Android Pro last week as there was no use in keeping it and my next projects will likely be in Unity 5, real shame.
     
  16. Pulov

    Pulov

    Joined:
    Feb 20, 2010
    Posts:
    824
    Could you try adding a camera to the vr controller. Culling to nothing so it does not render. With oclusion checked and a highwr field of view to match the fov on both vr cameras?