Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unity UI Masking doesn't work on Galaxy Note and Kindle Fire

I'm developing a game in Unity 5.2.2f1 and I'm using the canvas and image masking elements then building an .apk for Android. On most Android devices this works fine, but on the Galaxy Note 5 and the Kindle Fire HD, the masking doesn't take.

What's also interesting is that it DOES work on Galaxy Note and Kindle Fire HD when I use the default provided asset that is part of the unity_builtin_extra resource, but not when I use a .gif or a .png for the image asset.

Mask Works on all Android devices:

This works on everything

This works on everything

Mask only works on some Android devices:

Does not work on Note 5

Does not work on Note 5

I've also tried updating various setting like setting the cameras to forward rendering and enabling 32-bit Display Buffer (as other posts have suggested), but nothing so far has worked.

Any leads or thoughts on this would be greatly appriciated!

like image 932
Maxx Avatar asked Nov 08 '22 18:11

Maxx


1 Answers

In the past, I encounter similar problem with the UI Mask on Linux, there is a bug reported on it.

Since they haven't fixed it, I would not be surprise if some other devices have the same problem.

If the Mask purpose is for UI, then you could use the 2D Rect Mask instead which is way more efficient, but only made for UI and has some limitation.

As you can read in the doc :

The limitations of RectMask2D control are:

  • It only works in 2D space
  • It will not properly mask elements that are not coplanar

The advantages of RectMask2D are:

  • It does not use the stencil buffer
  • No extra draw calls
  • No material changes
  • Fast performance

Either way, I'd report your issue with a small test-bed project so they can test it out and eventually write a fix for it.

In the meantime, hopefully the 2DRectMask can be a workaround!

like image 126
ForceMagic Avatar answered Nov 14 '22 23:11

ForceMagic