Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scrollview softmasked items are visible outside viewport mask #82

Closed
maskedmouse opened this issue May 6, 2020 · 4 comments
Closed
Assignees
Labels
bug Something isn't working released on @preview

Comments

@maskedmouse
Copy link

Describe the bug
I've added a scrollview to my canvas with a softmasked item as child of content.
However, the scrollview's viewport mask does does not occlude the softmasked items under content.
Am I doing something wrong or is it broken in 2019.3.x?

The eventual use case is a ScrollView in a scrollview with content that is softmasked.
Complicated layered UI. But a use case for my work.

To Reproduce
Steps to reproduce the behavior:

  1. Go to Sample Scene
  2. Go into play mode
  3. scroll the list so that the item is half out of the viewport
  4. observe scroll view items not being occluded (hidden) outside of the viewport

Expected behavior
Softmaskable items in a scrollview list outside of the viewport should be occluded

Screenshots
Scrollview Softmask bug

Environment (please complete the following information):

  • Version: 0.10.0-preview.2
  • Platform: Editor Windows, WebGL
  • Unity version: 2019.3.12f1

Additional context
Project for reproduction
https://maskedmous.stackstorage.com/s/JYug7GMtoGk2THZ

@maskedmouse maskedmouse added the bug Something isn't working label May 6, 2020
@mob-sakai
Copy link
Owner

@maskedmouse
Thank you for reporting!

@mob-sakai
Copy link
Owner

mob-sakai commented May 7, 2020

Scroll View With Regular Mask Viewport

It was due to SoftMask ignoring the stencil.

  • Set the Use Stencil parameter to true.

Scroll View With Soft Mask Viewport

UIMask sprite has a small alpha.

  • Set the softness parameter to 0.01.
  • Or, use UISprite sprite instead of UIMask sprite.

@mob-sakai
Copy link
Owner

Action plans:

  • Change the default value of the Use Stencil to true.
  • If the parents contain some mask components, it is suggested to use stencil.
    • Some Mask components are found in the parents.
      Do you want to use stencil to apply the masks?
  • If the UIMask is specified as a Source Image, it is suggested to use another image.
    • SoftMask does not recommend to use UIMask as a Source Image.
      Do you want to use UISprite instead?

mob-sakai added a commit that referenced this issue Sep 8, 2020
github-actions bot pushed a commit that referenced this issue Sep 8, 2020
# [1.0.0-preview.8](v1.0.0-preview.7...v1.0.0-preview.8) (2020-09-08)

### Features

* if the 'UIMask' sprite is specified as the source image, it is suggested to use another image ([ea904db](ea904db)), closes [#82](#82)
* option to disable softening completely ([dedd847](dedd847)), closes [#98](#98)
* use the stencil buffer outside the scene view canvas for editing ([dbab85c](dbab85c)), closes [#100](#100)
@github-actions
Copy link

github-actions bot commented Sep 8, 2020

🎉 This issue has been resolved in version 1.0.0-preview.8 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released on @preview
Projects
None yet
Development

No branches or pull requests

2 participants