- Home /
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?
Answer by Castiel412 · Apr 24, 2015 at 06:01 PM
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).
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 :)
Yeas of course. The year 2020 and developers of the whole game engine cant implement soft mask out of the box. Then who can? The community of course. $$anonymous$$aybe managers just want to improve the assets store? Hm...
P.S. It's not the first feature that requested from developers of Unity for the last few years and still not implemented.
Answer by zxkne · Feb 06, 2017 at 08:25 AM
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.
Answer by NemoKrad · Dec 08, 2015 at 11:53 AM
Hi,
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: https://www.youtube.com/watch?v=KEA0bP7AX1U
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 :)
This script can't cut Images in hierarchy nor in the grid group