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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

uGUI Mask not working on Android

Discussion in 'UGUI & TextMesh Pro' started by MaeL0000, Sep 28, 2015.

  1. MaeL0000

    MaeL0000

    Joined:
    Aug 8, 2015
    Posts:
    35
    I have a Scroll Rect with a Mask on a Canvas set to World Space, it looks fine in Editor but on my Nexus 5 the mask is not being applied. Used to work fine before 5.2 I think but I have made a few changes since last time I tested so I can't guarantee that the Unity update is what broke it.

    "Use 32-bit Display Buffer" is checked and "Disable Depth and Stencil" is unchecked under Player Settings . The image is a Raw Image.

    Any ideas?
     
  2. robertsze

    robertsze

    Joined:
    Jul 8, 2013
    Posts:
    83
    Exactly the same problem here. Trying to render a rectangular render texture and masking it by a circle image to get a scope. Render texture always renders as rectangular. Used to work before 5.2
     
  3. MaeL0000

    MaeL0000

    Joined:
    Aug 8, 2015
    Posts:
    35
    does anybody have an update on this? Still not working for me..
     
  4. robertsze

    robertsze

    Joined:
    Jul 8, 2013
    Posts:
    83
    Yes, still not working. No reply to this thread, no reply to sent bug reports for weeks either.
     
  5. WonderWorkshop

    WonderWorkshop

    Joined:
    Aug 28, 2014
    Posts:
    7
    Hi, could I know what version you are using before 5.2? I am using 5.1.2 but I am having the same issue on Nabi Dream Tab running on 4.4.2
     
  6. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    881
    Also having this problem. Has anybody submitted a bug report yet?
     
  7. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    881
    Submitted a simple repro project with bug #751236.

    This is the simplest possible setup: a round mask above a simple red Image component (no raw images here, just Image).

    "Use 32-bit Display Buffer" makes no difference either way.
    "Disable Depth and Stencil Buffer" is UNCHECKED.

    Forcing OpenGLES2 does NOT fix it.

    In the editor and on most devices you see this:



    But on a Samsung Galaxy S6 you see this:
     
    Last edited: Dec 7, 2015
  8. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    881
    This is FIXED in Unity 5.3.0.f4.

    ;-)
     
  9. BrokenAngel

    BrokenAngel

    Joined:
    Mar 24, 2013
    Posts:
    92
    I'm using 5.3.5f1 and still get this problem :(
     
  10. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    881
    It seems to still be a problem on some Android devices but not others. We now have this problem again in 5.3.5p6, but no longer on the Galaxy S6. Combined with the poor performance of these stencil masks, we've simply thrown in the towel and are now working around by dynamically masking the texture pixels ourselves via script for those things that need masking. ;(
     
  11. IzzySoft

    IzzySoft

    Joined:
    Feb 11, 2013
    Posts:
    376
    Sowwy. :(

    I'm curious how your workaround works right now. No need to share if you don't want to. ;)
    any use of texture.SetPixels() ? hints?
     
  12. larku

    larku

    Joined:
    Mar 14, 2013
    Posts:
    1,422
    I'm not sure if this is the same issue, but all my masking fails on Android due to the shader using an if condition (clip(), or ternary operator all fail with same problem)

    Workaround by forcing GLES2 only (ie, in build settings, uncheck "Auto Graphics API" and then remove GLES3 from the available list).

    I've already created a bug report and Unity have repro'd the issue, it was supposed to be fixed in 5.4.0f3, but it still seems borked. I've followed up with Unity and am awaiting reply.
     
    Last edited: Jul 30, 2016
  13. inxidious

    inxidious

    Joined:
    Nov 8, 2013
    Posts:
    22
    I've tried in 5.4.1f1, it seems it has been fixed.