I put a alpha mask image with a gradient and that does not work as I was expecting. Only alpha 0.0 or 1.0 work. Any value between, doesn’t.
Am I missing something or its a bug?
I put a alpha mask image with a gradient and that does not work as I was expecting. Only alpha 0.0 or 1.0 work. Any value between, doesn’t.
Am I missing something or its a bug?
It’s a by design bug
Seriously, I think that’s not a bug, but there is a lack of an “advance” alpha mask.
A gradient alpha mask would be very nice.
We are using the stencil buffer which is either on or off for masking. You can do this with a custom shader on the element that is being masked, we have not tried this so I can’t say what the ‘best’ solution is.
Hey Tim, I’ve ran into this issue too. Could you supply a shader which does this or at least point to a shader which needs to be modified to do this? Gradient masks are a must have to make the scroll view look nice!
It’s unfortunately a non trivial thing to implement, which is partially the reason we have not done it yet (focussing on other aspects of the system). We will be investigating this more at a later date. 2 possible solutions exist (fun with alpha blending or fun with custom shaders).
Whatever you add in the future, I think the current method should also stay for those of us who don’t need alpha in the mask, because the stencil buffer thing is nice and quick and efficient.
The sooner the better … I agree that the stencil buffer solution should always be available. But I was actually surprised when I found out that “soft scroll areas” are currently not supported out of the box. It would be lovely to be able to just define an alpha-image for the
Mask
component to set this effect up, and for the use case mentioned above (non-rectangular masks) it’s actually a necessity.
Correct me if I’m wrong, but could you draw a frame of sorts over top of your scroll area to have a fade out effect? The mask would hard clip things out of the area and the frame drawn over top would give a smooth transition to the background color (or whatever you want). It’s not super pretty but I imagine it would work?
That’s a nice idea - definitely worth a try, thanks!
Has this been implemented yet? The idea of using a frame over the top only works for backgrounds with solid colors.
This was in 2014. Any news on this ?
In the road map for the 5.2 there is a last item (UI: Dropdown Control, 2D Clipping etc.) saying: “2D rectangle mask clipping that does not use stencil buffer.” Maybe this is it?
Here is a preview of support for the new 2D RectMask in TextMesh Pro which includes support for both Soft & Hard Masking.
Nice work Steve, glad you’re on to it. We are very happy with your plugin, keep up the awesome work !
I still have a few issues in Unity 5.2 related to masking which I reported and were confirmed by Unity. So as soon as those are fixed which will hopefully happen in the next Unity 5.2 patch, we should be golden on masking.
Cool. I’ve been on your forum page and keeping up to date with it as the releases keep coming.
We are at 5.2.2 now, did they solve the issue you mentioned?
By the way, after i have imported TextMeshPro if i look for Mask from Components->UI i only find the old Mask component, not 2D Rect Mask.
I have even restarted Unity.
The TextMeshPro Text component is there but 2D RectMask isn’t
I have Unity 5.1.1f
If you’re willing to pay $20, there’s a Unity plugin that does exactly what you’re looking for: Unity Asset Store - The Best Assets for Game Making