Search Issue Tracker

Fixed in 2020.1.X

Fixed in 2018.4.X, 2019.2.X, 2019.3.X

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. 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 (8)

  1. talleychan

    Nov 09, 2021 02:09

    Useful shares come from your article. Introducing to you 2 player games is a game list that includes a lot of game genres with different themes, join the game right away to enjoy the endless entertainment space. https://github.com/bumptech/glide/issues/4599

  2. shubhamswaraj2021

    Aug 18, 2020 04:45

    good one <a href="https://www.lyricsauto.com">lyricsauto</a>

  3. royjason721

    Apr 21, 2020 11:07

    You will consistently get one of a kind substance ensured 100% copyright infringement free. Our coursework composing administration doesn't sell pre-written or reworded content. We comprehend that you would chance your degree if your educators identify literary theft in your work, which is the reason we make a solid effort to create the tasks without any preparation.
    Regards : https://www.ukessaysexperts.co.uk/

  4. 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/

  5. 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/

  6. YukitoKono

    Jan 31, 2020 11:29

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

  7. 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.

  8. 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.