Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

UI Mask Failing on HoloLens, Works on Preview Fine

Discussion in 'Windows Mixed Reality' started by botgreet, Aug 9, 2016.

  1. botgreet

    botgreet

    Joined:
    Dec 26, 2015
    Posts:
    6
    Hi,

    Looks like others have seen this same issue, where the UI Mask looks great in preview but fails on the HoloLens and already filed a bug report, but wanted to see if there was any known work arounds or updates on any fixes or adjustments for the HoloLens in Unity:
    https://forums.hololens.com/discussion/1167/ui-mask-not-working-on-hololens

    e.g. Using the CurvedUI Asset from the Asset store, in preview I see this:



    On the HoloLens I see this:



    If I uncheck Mask on the Items, I see what I see on the HoloLens with images overflows....

    Thanks!
     
  2. Unity_Wesley

    Unity_Wesley

    Unity Technologies

    Joined:
    Sep 17, 2015
    Posts:
    556
    Hello,

    As of right now I'm not aware of any work around for the issue.

    Thank you,
    Wesley
     
  3. shouchard

    shouchard

    Unity Technologies

    Joined:
    Mar 29, 2016
    Posts:
    10
    We'll escalate this internally. Thanks for the report!
     
  4. BrandonFogerty

    BrandonFogerty

    Unity Technologies

    Joined:
    Jan 29, 2016
    Posts:
    83
    This should be working in the latest 5.4 build.

    In the following video, I created a UI Mask and it rendered correctly on the HoloLens.
     
  5. Unreal_Ed

    Unreal_Ed

    Joined:
    Mar 12, 2015
    Posts:
    2
    I am seeing this issue in Unity 5.4.0f3 even in the editor. I've set up my images identically to the ones in your video and the mask does not apply.

    In the attached screenshot, the "ReadMoreButton" has a mask and an image component with a sprite. I made the sprite dark yellow to show it on the screenshot. The gray overlay over the oval and text is the FillGazeSprite object in the hierarchy. It gets its width set from 0 to 1 through code. It should only show through everything that's in yellow here but it doesn't (and in the editor too, as you can see). That's with and without "Show Mask Graphic" toggled btw, and a World Space canvas.

    The mask IS working, it's just not using the image. If i resize the parent object everything gets masked by the rect transform bounds, as if i didn't have an image inserted.

    What should i do?

    NonWorkingMask.jpg
     
  6. botgreet

    botgreet

    Joined:
    Dec 26, 2015
    Posts:
    6
    Hello Brandon, on version 5.4.0f3-HTP, when I try to match your set-up and settings with quick 2 pngs I created with transparency, I can indeed get it to mask on the HoloLens like it does in Game mode, but that's when I take out "VR Supported" and "Windows Holographic" from the Player settings and it's rendering in 2D UWP mode... I didn't see the 2D Title bar in your video...so are you saying this is working for you in 5.4.0f3-HTP with VR Supported? Or did your experiment have VR-Supported checked?





    My test code linked....https://mandalbot-my.sharepoint.com...docid=0ab18d8068b9f4e3f834c6eeb5b4bf896&rev=1
     
  7. botgreet

    botgreet

    Joined:
    Dec 26, 2015
    Posts:
    6
    Okay, so, I did the following, and was able to get the mask to work.

    1) i switched my Sprites to TrueCOlor images. (still no mask after retry)

    2) I turned off 16-bit depth buffer ( still no mask after retry, think was a recommended settings for HL)

    3) When I checked the following highlighted setting "GPU Skinning", I finally could see the mask on the HoloLens with 5.4.0f3-HTP. So I think the mask is inoperable in the current version without this setting enabled. (not sure about whether 1 or 2 are required, but when I try to fix my app, probably be able to tell.)



    4) Also I seem to need to change the colorspace to Gamma from Linear to get this to show correctly on the HL.
     
    Last edited: Aug 27, 2016
  8. fafase

    fafase

    Joined:
    Jul 3, 2012
    Posts:
    156
    I managed to get the mask working without any tweak, just plain basic mask setting.

    I did see it failing back in July 2016 but the latest update most likely fixed it.
     
  9. dimitroff

    dimitroff

    Joined:
    Apr 3, 2013
    Posts:
    103
    Unity 5.5 here.. and the Mask still does not work on the Simulator, works fine in the Editor? Any ideas?

    Update: The only solution for me was turning 16bit buffering off
     
    Last edited: Dec 13, 2016
    Hodgson_SDAS likes this.
  10. cgmagic

    cgmagic

    Joined:
    Oct 5, 2013
    Posts:
    12
    Having the same problem here, just reported it. but where did you find the 16bit buffering option in Unity 5.5 ? Cheers
     
  11. dimitroff

    dimitroff

    Joined:
    Apr 3, 2013
    Posts:
    103
    Sadly, no where.. I still had to use the 5.4 version
     
  12. Zulu92

    Zulu92

    Joined:
    Apr 11, 2013
    Posts:
    13
    In Unity 5.5 you can switch inspector to debug mode and find "Ui use 16 bit depth buffer" property, then turn it off.
    When i migrate from Unity 5.4 to unity 5.5, unity5.5 take this property from unity5.4 and hide it from inspector's normal mode.
     
  13. kurtscheuringer

    kurtscheuringer

    Joined:
    Jan 5, 2017
    Posts:
    1
    Not to revive this old thread but UI masks are still not working in the HoloLens and I am using 2017.4.13f1. Seems to do with using Stencil buffers in general not working on the HoloLens.

    Using Rect2DMask is the work-around solution when dealing with Canvas / Unity UI components.
     
  14. GameDevCouple_I

    GameDevCouple_I

    Joined:
    Oct 5, 2013
    Posts:
    2,131
    These are still broken in 2018.4.0f1 - how is it that this has been ignored since 2016? I can see it was supposed to be fixed in unity 5 but we are on LTS 2018 and still no fix!?
     
  15. ferretnt

    ferretnt

    Joined:
    Apr 10, 2012
    Posts:
    309
    It's the Unity I-wonder-if-we-can-just-ignore-this-and-pretend-it-was-only-meant-to-be-used-for-pause-menus-until-runtime-UIElements-is-available-UI. On Hololens. Consider this thread a manhole to shout into.
     
    manugulus likes this.