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

Subtract method does not look smooth #203

Closed
oktayturkdagli opened this issue Oct 8, 2024 · 11 comments
Closed

Subtract method does not look smooth #203

oktayturkdagli opened this issue Oct 8, 2024 · 11 comments
Assignees
Labels
bug Something isn't working released

Comments

@oktayturkdagli
Copy link

oktayturkdagli commented Oct 8, 2024

Describe the bug
Subtract method does not look smooth. Also the inside image is not visible in subtracted image (just solving with adding additive softmask shape component in inside image). Also, the opacity and color settings of the inner image are distorted and do not reflect the true values.

Screenshots
Subtract Bug
Subtract Inner Bug
Canvas

Environment (please complete the following information):

  • Version [2.4.0]
  • Platform: [Editor(Windows/Mac)]
  • Unity version: [2022.3.52f1]
  • Build options: [IL2CPP, .Net 4.x, URP, HDRP]
@oktayturkdagli oktayturkdagli added the bug Something isn't working label Oct 8, 2024
@oktayturkdagli oktayturkdagli changed the title Subtract is not soft Subtract method does not look smooth Oct 8, 2024
@mob-sakai
Copy link
Owner

Thank you for your reporting!

@mob-sakai
Copy link
Owner

Could you please attach a minimal project (included Assets, Packages and ProjectSettings directories) that reproduces the issue?
Of course, you don't need to include any secret assets from your project. Feel free to use free assets instead.

@oktayturkdagli
Copy link
Author

Thanks for the response, I avoided it because it would take time to create a new project and reproduce it, but I figured you would want it 😅. I will create a test project as soon as I can.

@oktayturkdagli
Copy link
Author

Firstly, I apologise for the late reply, I have been going through a really busy period.
I don't know how it happened, but the problem with jagged visualisation seems to have been solved.
I took the final version of the package and I'm using it.

But I noticed some other problems:

  • Even though I set the Show Mask Graphic checkbox true in the Masking Shape components of the subtractors, it does not show the graphic.
  • Also please play with the alpha values of the subtractors. You will see that this does not work correctly.

You can find the project files and a sample video below.
SubtractProblem.zip

SubtractProblem.mp4

@mob-sakai
Copy link
Owner

The stencil isn’t functioning properly.
This will likely require a significant overhaul of the MaskingShape system... 🤔

@mob-sakai
Copy link
Owner

Is this the output you expected?

@mob-sakai
Copy link
Owner

Please try the release candidate package. 😃

"com.coffee.softmask-for-ugui": "https://github.com/mob-sakai/SoftMaskForUGUI.git?path=Packages/src#develop-preview"

@oktayturkdagli
Copy link
Author

I've actually shown the exact image of what I want in the example below. The circles completely cut out the masked images behind them. So that when it is made semi-opaque, the back will be seen correctly.

In this branch, the inner image is not visible. Also, when the masked image is made half opaque, the desired image is not obtained.

Ekran Resmi 2024-11-15 09 14 24

@mob-sakai
Copy link
Owner

Ah, I understand your intention.
In other words, you want to avoid the "see-through" effect between the foreground and background when making it translucent, correct?

The simplest and fastest method is to pre-clip the texture, as you demonstrated with the "MyAim/SubtractedImage" object.

The next easiest method is to emulate the "MyAim/SubtractedImage" object using a MaskingShape.
However, note that the two buttons will not be affected by the MaskingShape.



scene.zip

mob-sakai added a commit that referenced this issue Nov 17, 2024
mob-sakai added a commit that referenced this issue Nov 17, 2024
mob-sakai added a commit that referenced this issue Nov 23, 2024
mob-sakai added a commit that referenced this issue Nov 23, 2024
@oktayturkdagli
Copy link
Author

Ok, if I bind the button movement and the subtractor movement together, there seems to be no problem. I think it's ready for release. However, I would like to announce that I will carry out long-term tests later (in about a few weeks). Thanks for the solution 🙏

github-actions bot pushed a commit that referenced this issue Dec 1, 2024
# [3.0.0](v2.4.6...3.0.0) (2024-12-01)

### Bug Fixes

* fix anti-aliasing issues ([e68ee7b](e68ee7b))

### Features

* add 'SOFTMASKABLE' shader feature to improve shader build ([eec3212](eec3212))
* asset upgrade system 'SOFTMASKABLE' shader feature ([d36f932](d36f932))
* MaskingShape components always use stencil mask ([6c6ac59](6c6ac59)), closes [#203](#203) [#209](#209)
* strip shaders using ShaderVariantCollection instead of 'Always Include Shaders' ([5f4c435](5f4c435)), closes [#211](#211)
* update asset upgrade system to unregister always included shaders ([906bdb6](906bdb6))

### BREAKING CHANGES

* SoftMaskable shaders now require the `SOFTMASKABLE` shader feature.
Please upgrade assets from `Project Settings > UI > Soft Mask` or refer to the 'README > Usage with Your Custom Shaders' section to manually update your shaders.
@mob-sakai
Copy link
Owner

🎉 This issue has been resolved in version 3.0.0 🎉

The release is available on GitHub release

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
Projects
None yet
Development

No branches or pull requests

2 participants