Smaller element masked differently from another with mask
Describe the bug
I have a ScrollRect with mask to soften the edges. Inside I have "level icons" that are circles with mask to cut out the rectangular sprite into circle. In front of each circle, there is a paper element with score. That paper element is masked (faded) differently from the circle, allowing the circle to be visible from underneath. I'm not sure if I have bad setup or this is how it is supposed to work.
Additional bug that may be related. When I increase the softness range of the scroll view mask, I get this visual artifact (clear circle inside the circle):
This may be related to the circle foreground image:
To Reproduce Steps to reproduce the behavior:
- Download this sample project: https://drive.google.com/file/d/126l7p4nG6ouXf4uJh9AkrZdmUP9og8fY/view?usp=sharing
- Run it and open the "PaperMap" scene
- Play the scene.
- Scroll up and down until some paper element with circle gets to the bottom edge of the scroll view.
- Increase the "Viewport" softness range.
Expected behavior
- Circle and paper element should blend together - circle behind paper element should not be seen.
- No "clear circle in circle" artifact.
Environment (please complete the following information):
- Version 2.3.3 (as 2.3.4 and above cause compiler error on ShaderGraph for me).
- Platform: Editor Windows
- Unity version: 2023.2.9f1
- Build options: URP
Thank you for your reporting!
I'm not sure if I have bad setup or this is how it is supposed to work.
It is a specification. However, as you mentioned, it does look unnatural. Iβll look into ways to improve the appearance. π
For example, a method to compensate for soft mask magnification:
When I increase the softness range of the scroll view mask, I get this visual artifact (clear circle inside the circle):
In the latest version it has been fixed.
as 2.3.4 and above cause compiler error on ShaderGraph for me
Oops, it's my mistake. I'll create a new issue later.
Yes, this looks better, it will be nice to have, although my design has changed and I no longer have this paper element in front. :D
I haven't created ticket for the compiler errors, because I'm not using LTS version, so I don't expect everything to work great. I'll soon upgrade to Unity 6 and get the latest version of the plugin.
as 2.3.4 and above cause compiler error on ShaderGraph for me
This issue was fixed in version 2.3.9. π
Yes, this looks better, it will be nice to have, although my design has changed and I no longer have this paper element in front. :D
This enhancement has been released in version 2.4.0. π
I downloaded that version in the sample project and it seems increasing the power just makes it worse. I wish to go below 1? Or am I using it wrong?
Adjust the Foreground_Frameβs power.
Ah yes, silly me. That works, thank you.
I have another small editor issue. Sometimes (for example when I just started the sample project), when tweaking the Power value while the game is running, everything in the soft mask stops drawing. Maximizing the game view (i.e. changing the resolution?) fixes it.
Similar thing happens on my original project, often when switching between fullscreen and window and clicking/drag the scrollview? - softmask stops drawing. To go fullscreen I use the Fullscreen Editor plugin, but I don't think it's related. (in the gif, I switch to fullscreen via hotkey, so the whole image changes suddenly multiple time). Showing the pause menu overlay also fixes the drawing (enabling game objects?)
(sorry for hijacking the issue, maybe create another issue? π )
Oh... I would like to know more about this issue. Could you please create a new issue? (Please attach a minimal reproducible project.)
Thank you π