Search Unity

Google Cardboard and Unity Free - possible?

Discussion in 'AR/VR (XR) Discussion' started by jbjbjbborisb, Feb 24, 2015.

  1. jbjbjbborisb

    jbjbjbborisb

    Joined:
    Jun 8, 2014
    Posts:
    54
    Hi there!
    I would like to get started with some fun VR projects using Unity.

    As far as I know Unity Free supports Oculus Rift since version 4.6.
    That's nice, but sadly I do not own a Rift (would be too expensive for just playing around anyway).

    But what I've got is a Google Cardboard VR headset (== smart-phone inside a cardboard box) :)
    Google offers a free Unity SDK, but it will only work with Unity Pro. This is because they are using some nifty distortion shaders.

    Can anybody tell me if the Cardboard SDK will work with Unity Free now, too?
    Or can I use the Unity Oculus Rift integration to build Cardboard compatible apps?
    Is there any other way to get Cardboard support in Unity Free?

    Thanks :)
     
  2. sleekdigital

    sleekdigital

    Joined:
    May 31, 2012
    Posts:
    133
    https://developers.google.com/cardboard/unity/get-started

    The first thing it tells you to do is activate pro, so it seems pretty safe to assume that pro is required. It might be possible to turn off the distortion effect tho. It should be pretty quick and easy to try it out for yourself.

    Another option is the Dorvis Dive SDK...
    https://www.durovis.com/sdk.html

    You can even simply use something like this (attach it to a rig of two cameras setup in VR fashion)
    http://blog.heyworks.com/how-to-write-gyroscope-controller-with-unity3d/
     
    Daoqi and Taokey like this.
  3. jbjbjbborisb

    jbjbjbborisb

    Joined:
    Jun 8, 2014
    Posts:
    54
    Hi sleekdigital,
    thanks for your reply. You wrote:
    but in the Cardboard SDK release notes you find lots of references to Unity Free, too. For example:
    Which keeps me wondering if Unity Free is supported or not...

    I guess when I get home I'll download Unity Free and give it a try...
     
  4. sleekdigital

    sleekdigital

    Joined:
    May 31, 2012
    Posts:
    133
    yeah, you can probably just turn off the distortion and use it with free.
     
  5. jbjbjbborisb

    jbjbjbborisb

    Joined:
    Jun 8, 2014
    Posts:
    54
    I thought the distortion was essential to the "VR experience"?. Aren't the lenses in the VR headset shaped in way to work only with specifically distorted images?
     
  6. sleekdigital

    sleekdigital

    Joined:
    May 31, 2012
    Posts:
    133
    I would say that it depends on your project. The distortion will certainly help if you need things to look realistic.
     
  7. jbjbjbborisb

    jbjbjbborisb

    Joined:
    Jun 8, 2014
    Posts:
    54
    OK, I tried it yesterday. Long story short: it does not work.
    The distortion shaders required by the Cardboard SDK are missing in Unity Free, which gives ugly/unusable results.

    Too bad :-(
     
  8. JDMulti

    JDMulti

    Joined:
    Jan 4, 2012
    Posts:
    384
    I'm doing a Cardboard project myself, but without the distortion it still looks fine. However the stereoscopic effect is less strong, but everything else is just as in the editor, only 2 separate cameras.
     
  9. jbjbjbborisb

    jbjbjbborisb

    Joined:
    Jun 8, 2014
    Posts:
    54
    This seems to be highly subjective.
    For me the undistorted stereo view feels quite strange and unpleasant...
     
  10. JDMulti

    JDMulti

    Joined:
    Jan 4, 2012
    Posts:
    384
    Doesn't this also depend on the size of the phone? I tested also a phone where both views were not really square but rectangular, and that was indeed strange. However with a correct phone size it's looks just fine.
     
  11. sleekdigital

    sleekdigital

    Joined:
    May 31, 2012
    Posts:
    133
    I would expect to generally get better visual results with the distortion applied, but it comes at a price. I imagine some of the apps out there leave it out on purpose for performance reasons. I read that this game doesn't apply the distortion, for example...
    https://play.google.com/store/apps/details?id=com.sc0ttgames.RocketDropVR&hl=en

    I don't know if square vs rectangular has any affect or not, but I would also look at camera FOV settings and IPD (distance between the 2 cameras and how that is managed).

    Did you try the Dorvis Dive plugin? It doesn't do the barrel distortion, but it does try to manage IPD correction.
     
    Daoqi likes this.
  12. Nothnless

    Nothnless

    Joined:
    Oct 10, 2014
    Posts:
    38
    Hey, you guys just blew my world up!

    I'm new to the whole VR thing so maybe you guys can enlighten me a bit.

    I made the game below using google cardboard SDK and Unity free:

    https://play.google.com/store/apps/details?id=com.BowersLLC.SpaceInvaders

    It has a link to the youtube video (I'm not expecting you to purchase it).

    It seems to work just fine in my cardboard headset however I've never tried any other headset so I'm not sure if I'm providing the type of VR experience people are expecting.

    It seems to look just as good as any of the other games on google playstore that I've downloaded so I'm totally confused about this thread saying the cardboard SDK only works with pro.

    But you guys are saying that this is supposed to be distorted and I'm not really providing a true VR experience right? How disappointing...
     
  13. jbjbjbborisb

    jbjbjbborisb

    Joined:
    Jun 8, 2014
    Posts:
    54
    Yep, you don't have the barrel distortion effect, that compensates for the lenses in the VR headset.

    Good news:
    Unity Free is gone. Unity Personal has all the features of Unity Pro and can thus handle the distortion effect.

    Bad news:
    The cardboard SDK for Unity is not ready for Unity 5. It does NOT work properly, so you'll have to wait for an update.
     
  14. sleekdigital

    sleekdigital

    Joined:
    May 31, 2012
    Posts:
    133
    Here is how I look at it ... Thousands of people wear bifocal/progressive glasses in their daily lives and these cause some distortions... are these people not having a true life experience? Missing the barrel distortion is not the end of the world, and in some cases its better to leave it out for performance reasons. In some projects it will be less noticeable depending on the content you are displaying. You have to decide what is best for your project. The barrel distortion is fairly expensive and might contribute to your frame rate dropping which in many cases is worse than not having the distortion.
    Obviously, the lens correction is very desirable, but its not always possible to have that AND the solid frame rate needed for VR.

    I just tested the cardboard SDK in Unity 5 and it worked fine for me. It did ask me to update the android SDK when I did the build. Once that was finished I had no problems.
     
    Daoqi likes this.
  15. jbjbjbborisb

    jbjbjbborisb

    Joined:
    Jun 8, 2014
    Posts:
    54
    From my experience the barrel distortion does not slow the game down in any way. But maybe my project's were too simple ;-)

    That would be really strange. Google themselves published some known issues with the current version of Unity. In the Cardboard Git Hub issue tracker you can find lots of posts and example videos that illustrate the problems.
     
  16. sleekdigital

    sleekdigital

    Joined:
    May 31, 2012
    Posts:
    133
    Google does all they can to keep the performance hit to a minimum, but you can't remove it entirely. Whether or not you see any impact or not is going to depend on your project. In my case, I have an app that plays video and it doesn't play as smoothly with the distortion enabled. Some other optimizations might fix that, but the point is it does currently play more smoothly without the distortion on.

    Its not strange at all. "Known issues" and seeing issues in git hub does not mean something is completely broken or unusable. The only Google published known issue specific to Unity 5 I see is this...

    • Unity5 black screen: Calls to GUI methods (e.g. GUI.Button) conflict with calls into the native SDK via the GL class (GL.InvalidateState and GL.IssuePluginEvent), resulting in an all black screen. The root cause is under investigation, with assistance from Unity.
    That just means you can't use the GUI API. It causes their demo not to work, but it does not mean it is completely broken. It's easy enough to work around this until it gets fixed. You just have to temporarily turn off any GUI functionality if you have any.
     
  17. HoverX

    HoverX

    Joined:
    Aug 15, 2012
    Posts:
    18
    I can confirm that it works as well as I'd expect in Unity 5 Personal edition. As mentioned before, Unity asked me to update the scripts but afterward everything was fine. It even seems to do distortion once it's compiled to the phone.

    In fact, switching to Unity 5 fixes a bug that Google's Unity SDK used to have. It no longer disables the gyro and accelerometer data in the Unity API. I'm not sure what caused or fixed that one but it's a huge win.
     
    Daoqi likes this.
  18. Nothnless

    Nothnless

    Joined:
    Oct 10, 2014
    Posts:
    38
    Hi, a couple of quick questions.

    If I download Unity5 can I still keep Unity4 or will it just upgrade it?

    Also, if I just open my Unity4 made game in Unity5 will it still work the same or will I most likely have to recode stuff.

    I really want the distortion effect but I dont want to have to remake all my games.

    When you say you have to update the script do you mean you had to go in and recode it? Or did it update automatically? I cant code, so If someone has an updated SDK please send a link.
     
  19. dolims

    dolims

    Joined:
    Sep 13, 2014
    Posts:
    61
    A couple of ways to make the Cardboard SDK work better in Unity 5:
    • Eliminate the SkyboxMesh and StereoLensFlare scripts (not needed anymore, caused import problems)
    • Do not use GUI class methods or OnGUI functions
    • Turn on the Development Build option in the Build dialog
    These are workarounds till the actual bugs are fixed.
     
    Daoqi likes this.
  20. luckysimmobile

    luckysimmobile

    Joined:
    Mar 17, 2015
    Posts:
    1
    this site helps finding for >>> backlink <<< Free
     
  21. RennigeB

    RennigeB

    Joined:
    Jul 2, 2015
    Posts:
    1
    Hai, i am use unity 5.1 and running google cardboard demo scene. but it not show stereoscopic. I tried to set direct render false, still not show stereoscopic. Can you help me,thank you