Search Unity

Any way to set up two cameras with different culling masks with GoogleVR?

Discussion in 'AR/VR (XR) Discussion' started by wojwen, Feb 24, 2017.

  1. wojwen

    wojwen

    Guest

    I'm trying to set up tow cameras with different culling masks and ClippingPlanes because otherwise I have to set nearClippingPlane to very low value so the cockpit of my ship is vivsible, but at the same time it causes mesh clipping on objects that are far away(I don't know why, it just works like this). The perfect solution would be to set up two cameras - one for cockpit with low nearClippingPlane and one for everything elese with high nearClippingPlane so there is no mesh clipping. The problem is that when I try to set up two cameras with different clipping planes values and depths the final image is completely wrong - the image from "cockpit camera" appears only on the bottom of the screen and in some middle part, also seems to be shifted. Does anyone know how to deal with this or maybe you have a better idea for solving this? I'm using Unity Daydream Preview 5.4.2f2-GVR13 and GoogleVR SDK 1.0
     
  2. Dirly

    Dirly

    Joined:
    Mar 24, 2013
    Posts:
    19
    did you ever find a solution to this?
     
  3. NGC6543

    NGC6543

    Joined:
    Jun 3, 2015
    Posts:
    228
    The cockpit camera's clear flag should be set to 'Depth Only'(I assume you'd set it that way though)
    And the cockpit objects are closer than the 'background', so the render order(Depth value on Camera component) of the Cockpit camera should be higher than that of background camera.

    But I just keep thinking that you can do the same with one camera. Because the more camera, the more performance cost(occlusion culling, rendering, shadow etc...) you might get.

    Also, if the far meshes are clipped, try using fog to hide them. Lower rendering distance would also benefit in rendering(less objects would be rendered)

    ----
    And you asked about culling masks but the details are about clipping planes. What problems are you experincing exactly?