Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on Dec 8, 2022, between 7 am & 7 pm EST, in the DOTS Dev Blitz Day 2022 - Q&A forum, Discord, and Unity3D Subreddit to learn more about DOTS directly from the Unity Developers.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Android Free Culling mask not supported / Bug?

Discussion in 'AR/VR (XR) Discussion' started by JDMulti, Jan 15, 2015.

  1. JDMulti

    JDMulti

    Joined:
    Jan 4, 2012
    Posts:
    384
    I downloaded the Google Cardboard project and exported it with the Android Free version. I did read that you need Unity Android Pro right? However, the free version of Android worked and the Google standard Cardboard App was just perfect.

    However, I'm now creating my own application and having two separate cubes with a panorama photo. I have both of them set in a layer and per camera defined to not render a specific cube. To be more precise, I have "Cube Left" and "Cube Right" both in a separate layer named: "Eye Left" and "Eye Right". The left camera is only rendering layer "Eye Left" and the right camera layer "Eye Right".

    When I publish the application and run it, I see both cubes being rendered in both cameras. Am I doing something wrong or is Camera Culling Masks not supported in Android Free? I do have Unity 4.x Pro, and when I run the game in the editor, both cameras render only there specific Cubes and not both.

    It's like I smell a Unity Bug here... correct me if I'm wrong.
     
  2. dolims

    dolims

    Joined:
    Sep 13, 2014
    Posts:
    61
    The CardboardEye script has a function CopyCameraAndMakeSideBySide() that clones settings from the parent Main Camera. It's trying to make sure that anything which modifies the Main Camera gets reflected onto the stereo cameras. That's probably resetting your culling mask on each of the stereo cameras. Right now, the only way around this is to edit the CardboardEye script and add your layer to the mask after the line that calls CopyFrom().
     
  3. JDMulti

    JDMulti

    Joined:
    Jan 4, 2012
    Posts:
    384
    Aaah ok, that explains why it wasn't working. I'll try this out and see if I can fix my application to work on Cardboard and Oculus Rift. Thanks for the information.