Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

RectMask2D support

A topic by iiley created Nov 13, 2020 Views: 296 Replies: 5
Viewing posts 1 to 6

I'm making a scroll rect which will contains a big list of text items, after some experiences, i saw that RTM does not works well with RectMask2D,  however it works with Mask, but the SetPass calls will double.

Is there a way to let me make RectMask2D works to gain the performance benefits? 

Thanks!

Developer

Looking into RectMask2D, it says it doesn't use the stencil buffer, which is what STM uses to mask itself with Unity UI, so I don't think it's compatible for the time being, unfortunately...

I'm trying to research how I can make it compatible... if I can find it, I'll try to add it!

Thank you very much, hope is will be supported, I did more testing,  RectMask2D really saved a lot of pass calls / batches for general use.

(1 edit)

Ran into this when trying to first use the component.  It might be a deal-breaker from us.  What's the alternative to create a mask?

Developer

Hello,


Hm, I'll look into this but I did recently add basic mask compatibility to all the shaders that come with STM, so basic masking should at least work.

Looks like for RectMask2D support I just need to implement the IClippable interface (https://docs.unity3d.com/2018.3/Documentation/ScriptReference/UI.IClippable.html) in addition to IMaskable on Super Text Mesh in order to make it work... I think it should be possible judging by the documentation, but I won't be able to look into this until at least Monday.

Developer

Okay so I gave this an honest try and I've got to say it's a huge headache... I had every aspect implemented and got confirmation that this code was being called: https://docs.unity3d.com/ScriptReference/CanvasRenderer.EnableRectClipping.html


...But it didn't seem to change anything at all about the text being rendered. Unity has 0 docs on how to implement IClippable, and even going into the source code, I'm having trouble telling exactly what's missing. So I'm going to suggest to just use regular masks for the time being, as much as I want this to work. Sorry...