Unity3D + Google Cardboard SDK = No UI masking - android

UI mask do not work with Google's Cardboard SDK? It works properly with the Oculus Mobile VR plugin but with the Cardboard SDK the masks seem to be gone.
http://postimg.org/image/b2by7exu9/
This screenshot demonstrates it, outside of the white box we should not see any text.
http://postimg.org/image/ts8wgfu7l/
In editor and with VR Mode disabled it looks fine.
Did anybody encounter this issue and know how fix?
In which direction should I investigate further?
I already tried the builds on Note 4 and Galaxy S3 with two different projects just to be sure. Logs didn't show striking lines. I googled and did not found anything related to this issue. Answers and forums the same.
Any suggestions highly appreciated!

While not an answer to your question - I figure after this long any information could be helpful:
I've noticed that the Cardboard SDK in general doesn't play nice with the Unity UI at times. I found that when enabling or disabling VR mode on Cardboard, my UI would cease to respond to touch inputs on other (2D) scenes. I solved this by turning VR mode before changing scenes. So perhaps you need to dig around inside Google's code to see where it's messing with your UI...

have you re-tested with Unity 5.3? there were a bunch of improvements in this area including a re-write of the masking system.
Alternatively, check out the UI Soft Alpha mask component as part of the UI extensions project (https://bitbucket.org/ddreaper/unity-ui-extensions) which is a shader based mask system with Alpha support
Hope this helps

I discovered this still happening in Unity 5.6.0f1 with Google Cardboard. I was able to fix it by going into the Cardboard SDK settings (PlayerSettings (Android) -> Other Settings -> Virtual Reality SDKs -> Cardboard) and switching the depth format to "24-bit depth | 8-bit stencil" (since the UI mask uses the stencil buffer). This solved the masking problem for me.

Related

My Unity game for Android does not work in Bluestacks

I just launched my game on Google Play, it works fine on Android devices, but if I try to boot it though Bluestacks emulator the Unity splash (sometimes) shows and after that only a dark grey screen and nothing happens
This is how it looks after the Unity Splash intro
I have tried to install the game though Google Play and by installing the Apk file itself, both ways dont work.
I'm using v2021.1.18f1 to build the game
The game itself is here https://play.google.com/store/apps/details?id=com.BrokenGlass.TapNinja
Thank you.
UPDATE
I fixed it by changing a lot of settings in the Player Settings, not sure which is the one that actually made it work. Raguels answers was partially correct, but changing only the Graphics API did not work.
This is how my Player Settings look
It is happening because you didn't include some of the supported graphics API in your android build. Bluestacks might not work if you omit OpenGLES2. Make sure you have OpenGLES 2 in your supported graphic APIs. You can find it in Project Settings/Player/Other Settings
To make it available, you will have to change the Color space from Linear to Gamma.
For me worked changing "Optimized Frame Pacing" to disabled, in Proyect Settings/Player/Resolution and Presentation

How do I switch between normal mode and VR mode during runtime?

Android 4.4 Unity 5.6 Google VR SDK 1.7. I have followed this https://www.youtube.com/watch?v=pA3NB9OZppo to switch between vr and normal modes during runtime but normal screen become stretched out and doesn't look like what it originally is. How do I properly do this in Unity3d?
I apologize for the unclear format or whatever, but for anyone stuck in this problem I found my own answer here at the sdk forum.
https://github.com/googlevr/gvr-unity-sdk/wiki/Switching-between-VR-and-non-VR-at-runtime

Unity3D Android visual artifacts

Since a while ago I started having some artifacts on some android devices. I have checked build settings, I was disabling code stripping and setting all options to the default ones - nothing worked out.
This visual interference (see screenshot) happens at least in Note II and HTC One Mini/2. Nexus 5 exhibited very minor interferences.
Any help would be highly appreciated!
Picture here
Well, that was quite obvious, I just needed to turn on my brain, lol.
So, if you're having issues with rendering like I was - try to check your main camera.
And especially be careful with Clear Flags property. Personally, I have faced with a situation when some of my background layers (which have SpriteRenderers on) were switching their alpha values. At that point camera would "see" through the layers. And that is the problem if you have "Don't Clear" value in "Clear Flags" property.
Hope it helps.
which Unity version are you using? Can you make sure to use ETC1 compression (+alpha if needed) and try again on those devices?

Google Cardboard for Unity renders only one light source

I downloaded Google Cardboard SDK for Unity. In the demo scene, I put 2 light sources (spot with default settings). As you can see in this image, the two light sources are rendered in unity editor and game mode, but only one light source is rendered on my Android 5.1.1 phone.
Is the "one light source max" a Cardboard limitation I am not aware of? Or am I doing something wrong?
Thank you for your help
It's not a Cardboard limitation. Doublecheck that you have enabled more than one pixel light source in the project's Quality settings for Android.

How to invert camera/controls for Unity Android VR App?

I have a fresh project in Unity with the Google Cardboard SDK imported. Default orientation is set to Landscape Right.
Whenever I load up the build on my Android device, everything is upside down. Also, if I look left in real life, it turns my head right on the phone, and vice versa. The camera and controls seem to be inverted.
I've somewhat fixed the camera problem by rotating it 180 degrees. Great. But, my controls are still inverted.
What I need to know is how to invert controls on Unity. Or some way to fix this problem.
There's a bug in the SDK v0.4.10. Check out the repo issue.
You can either downgrade to the v0.4.9 or upgrade to Unity 5. I suggest both.

Categories

Resources