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

It works in Editor but not in Android #222

Open
sametbaykul opened this issue Dec 31, 2024 · 9 comments
Open

It works in Editor but not in Android #222

sametbaykul opened this issue Dec 31, 2024 · 9 comments
Assignees
Labels
bug Something isn't working need more info Need more information to help

Comments

@sametbaykul
Copy link

Hi,

Describe the bug
I use this asset for tutorial highlights for a long time. Briefly, I use an image that fades the entire screen. I use a soft mask in the areas I want to highlight.

I upgraded the asset from 1.0.2 to the current version 3.1.2. The soft mask still works fine in the editor. But soft mask didn't work in android build any more.

I updated all required shaders on Player Settings (Plz look at screen shot).
Ekran Resmi 2025-12-31 14 48 04

Environment (please complete the following information):

  • Version 3.1.2
  • Platform: From MacBook Air M1
  • Unity version: 2021.3.44f1 Personal
  • Build options: IL2CPP
@sametbaykul sametbaykul added the bug Something isn't working label Dec 31, 2024
@mob-sakai
Copy link
Owner

mob-sakai commented Dec 31, 2024

Thank you for your reporting!
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.

repos

@mob-sakai
Copy link
Owner

I would like to know more about this issue.

@sametbaykul
Copy link
Author

  • Screen `Space - Camera' mode
  • URP
  • No ShaderGraph
  • Texture Compression Format > ASTC (I also tried with ETC2, but no luck)
  • No any other material used (Standard)
  • Render Scale > 1, No dynamic resolution

@mob-sakai
Copy link
Owner

Thank you.

If you are in a hurry, consider using the 'Anti Aliasing' mode.

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.

@mob-sakai
Copy link
Owner

No any other material used (Standard)

"Standard" means "UI/Default", right?

@sametbaykul
Copy link
Author

Since I work in a huge project, it is not possible to share or repro the same issue. But I can provide project settings you ask.
Yes, I used "Hidden/UI/Default (SoftMaskable)" shader.
"Anti Aliasing" mode didn't work in Unity Editor. Subtract masks disappeared.

@mob-sakai
Copy link
Owner

Start with an empty project and create a scene that reproduces the issue.

No images or scripts are required.

@mob-sakai
Copy link
Owner

"Anti Aliasing" mode didn't work in Unity Editor. Subtract masks disappeared.

It is probably due to the sorting order of the objects.
Place MaskingShape(Subtract) in the hierarchy above.

@mob-sakai mob-sakai added the need more info Need more information to help label Jan 6, 2025
@sametbaykul
Copy link
Author

First of all, thank you for your interest and such an amazing tool. Unfortunately, I don't have a chance to create a new project to reproduce the issue, I hope you understand this. However, I did some experiments and I would like to share my notes.

  • After making the correct order, the anti-aliasing mode worked. I decided to proceed this way for now. (Shortcut Solution)
  • After setting SoftMask, SoftMaskable, MaskingShape in the hierarchy panel in Editor Mode, there is no problem in both the Unity editor and the Android device. Same as in the example scene. (Static Solution)
  • However, problems may occur when these components are started or modified at runtime. For example, when a component is enabled/disabled, the image source or transform scale is changed etc. (Dynamic Solution has some issues)

I think some precautions or guidance can be made for this:

  • If the components are to be started at runtime, in which order should they be started? A directive can be prepared for this.
  • We can use a method like Refresh or Update to prevent buffer delays and possible problems after modification processes.

Please also note that, I don't have much experience with shaders. I use this package as a part of a versatile tutorial system. Therefore, the GameObjects and components used are constantly changing in runtime. I hope these notes can be helpful for further improvements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working need more info Need more information to help
Projects
None yet
Development

No branches or pull requests

2 participants