new UI Mask soft cutoff

Is it possible for a mask to have soft cutoff boarders?

I have a scroll view on my GUI which can only extend to a certain point horizontally. Once that point is reached I want the Mask to cutoff whatever elements go past this point.

I achieved this just following the tutorials but I don’t seem to find an option to change the cutoff from a hard cutoff to a soft one. Is it even possible at this point?

Tim C from Unity had this to say regarding this issue:

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.

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

Thread here

So it seems that this is not possible to do out of the box and would require some work to make it happen. I think I will wait until Unity implements it directly or someone creates an asset for it :slight_smile:

If you want a component, that is used in an exactly same way as Unity’s standard Mask but supports gradients and semi-transparency, you can check out my recently published Soft Mask. The main feature is that you just replace Mask component with a Soft Mask on the GameObject and everything just works as expected.


I have created a package that will do this for you (I think it is what you are after) you can check out the video I did for it here:

I have a Facebook page called “Charles Will Code It!” and some one posted this request to me so I wrote it, come and join and you can get this package for free, or you can wait until it has passed review on the asset store and get it there for $10

Hope this helps, let me know either way :slight_smile: