• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
3
Question by mateiasu · May 11, 2015 at 11:00 AM · androidshader

VR related mask shader issue?

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.

alt text

This screenshot demonstrates it, outside of the white box we should not see any text.

alt text

In editor as well in 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!

UPDATE

I've came across the same issue with the Oculus Mobile SDK / GearVR Note4 as well. This happens when in the OVRCameraRig the Texture Depth is set to 16 instead of 24 bit.

device-2015-05-13-124706.png (462.3 kB)
worldcanvasmaskcardboard.jpg (74.6 kB)
Comment
Add comment · Show 4
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image dolims · Jun 01, 2015 at 08:19 PM 0
Share

A few questions: Are you still having this issue? Also, what is that red hatching on the right half? Which version of Unity? Free or Pro?

avatar image mateiasu · Jun 07, 2015 at 11:16 AM 0
Share

Yes, I still experience this issue and didn't find any hint yet why the Cardboard SD$$anonymous$$ breaks masking.

The red hatching is manually overlayed for explanation.

I've deployed this demo with U3D Pro 4.6.5f1 .

avatar image dolims · Jun 07, 2015 at 11:57 PM 0
Share

I have no immediate idea what would cause this issue, but I can investigate. Some more questions: Is this Canvas being drawn in World Space or Screen Space - Camera? Which version of the Cardboard SD$$anonymous$$?

avatar image mateiasu · Jun 08, 2015 at 06:28 PM 0
Share

I've tried this with another fresh project (Cardboard Demo Project) and the same result can be seen.

For your questions:

The Canvas is being drawn in World Space and the middle camera is referenced as world camera (I tried all, left, right eye and the centered one).

Cardboard SD$$anonymous$$ I'm using is version v0.4.10 (4/16/2015) (from CHANGELOG) and the commit hash is 3a9f4cb2c756aad4dfe9f6a4f3009eb778492180.

4 Replies

· Add your reply
  • Sort: 
avatar image
3

Answer by JBPrime · Apr 28, 2017 at 05:51 AM

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.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by angecroft · Nov 08, 2016 at 11:36 AM

Hi I'm currently having the same issue with Unity 5.4.2f2-GVR10 only on a cardboard build. Do anyone have solved it yet ?

The UI Mask works just fine on Gear VR with a normal build.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Abrita · Nov 16, 2017 at 03:42 PM 0
Share

Remove the $$anonymous$$ask component and add a new componet, the Rect $$anonymous$$ask 2D, solved for me using Google Cardboard

avatar image
0

Answer by Abrita · Nov 16, 2017 at 03:43 PM

Remove the Mask component and add a new componet, the Rect Mask 2D, solved for me using Google Cardboard

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image stenfeio · Aug 27, 2018 at 03:13 PM 0
Share

Attempted to do this but now Rect$$anonymous$$ask2D does not properly show images of children under it. What's odd is it doesn't even seem to be masking a rectangular area. Some Image sprites show up and others don't. Any ideas?

avatar image
0

Answer by binoman · Jul 12, 2018 at 08:54 AM

I'm having a similar issue. When using the mask, the hole screen is black on both eyes. Switching to 8-bit stencil and using Rect Mask2D did not solve the issue. I'm using Unity 2018.1 Any Ideas?

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

25 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Set default number/emails in a new text message/email sent via unity 0 Answers

Shader works in editor but not on Android 1 Answer

Transparent shader for Android 1 Answer

Alternative Android Shader for Fragment? 0 Answers

Why Do Android Devices Hate This Shader? 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges