Search Issue Tracker

Fixed in 2020.1

Fixed in 2018.4, 2019.2, 2019.3

Votes

6

Found in

Issue ID

1014187

Regression

No

[WebGL] RectMask2D does not mask

WebGL

-

Reproduction Steps:
1. Open the attached project.
2. Open the SampleScene.
3. File->Build Settings->WebGL->Build and Run

What's Expected:
* The text should be clipped. You can see that in the Unity Editor's Scene and Game tabs.

What's Perceived:
* The text is not clipped when the project is run in the WebGL player.

Additional Notes:
* I've done my best to confirm that this issue is isolated to WebGL and works on other platforms (enabling IL2CPP and running in OpenGL ES compatibility).
* From my newbie eyes, it looks like the UNITY_UI_CLIP_RECT shader #define is not accepted in all cases on WebGL, by the graphics device.

Workaround:
1)
- copy UI/Default shader to the Assets folder and change the name in the source (UI/Default => UI/Custom)
- create a new material that uses the custom UI shader
- assign the new material to the UI objects
- at runtime use EnableKeyword("UNITY_UI_CLIP_RECT") on the material

2) use Mask component instead

  1. Response avatar

    Resolution Note (fix version 2020.1):

    Currently not fixing since there are workarounds available.

    Workaround:
    1)
    - copy UI/Default shader to the Assets folder and change the name in the source (UI/Default => UI/Custom)
    - create a new material that uses the custom UI shader
    - assign the new material to the UI objects
    - at runtime use EnableKeyword("UNITY_UI_CLIP_RECT") on the material

    2) use Mask component instead

Comments (5)

  1. 879d111529f600046dfc1281180eb17d?d=mm

    ThomasMore1

    Apr 01, 2020 12:27

    It is absolutely insightful to take the greatest and bossiest as your consultant, and what they state will at last go. Yet, we urge you to likewise search out individuals in the office or in a related office and develop a collegial relationship with them. In truth, scholastics are not really the most socially proficient individuals.
    By: https://www.domyessays.co.uk/

  2. 879d111529f600046dfc1281180eb17d?d=mm

    ThomasMore1

    Mar 30, 2020 07:30

    It is stunning what number of senseless stories you hear after some time. Think about this one: A Ph.D. up-and-comer in an enormous city was getting back from drinks with his companions one night. He was then suddenly looted at weapon point. At the point when the cheat pointed the weapon at the youngster, he asked "Don't shoot me! I'm writing my exposition!"
    By: https://www.writemyessays.org.uk/

  3. 9f8e6fd8445c7e3aa828843391dadc0e?d=mm

    YukitoKono

    Jan 31, 2020 11:29

    本当にありがとうございます https://xn--lck0a4d411qemf.jp/royal-panda-online-casino/ 私はこのプロジェクトで多くのことをしました。

  4. 16ac0964d997a183b8239a32f103de6d?d=mm

    Bunderant

    Feb 15, 2019 19:08

    Gotta say, this is a pretty frustrating "Won't Fix". I've been using RectMask2D wherever I could get away with it, being the recommendation to use where possible for general UI optimization.

    I feel like you guys should at the very least provide a warning that it won't work in builds in the component inspector (if set to the WebGL platform), and provide the same warning in the console output after a build if any included scenes or prefabs use the RectMask2D component.

  5. Ca6a490d369ec3ef484ce3a734d5c53e?d=mm

    undefined666

    Sep 10, 2018 13:12

    +1.have this issue too.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.