mob-sakai / SoftMaskForUGUI

Enhance Unity UI (uGUI) with advanced soft-masking features to create more visually appealing effects!
https://github.com/mob-sakai/SoftMaskForUGUI
MIT License
2.03k stars 265 forks source link

Shader Graph Support #190

Closed GID0317 closed 3 weeks ago

GID0317 commented 4 weeks ago

Describe what help do you need While creating a UI shader with Shader Graph using the sprite unlit option, if you attempt to apply a mask, the Shader Graph disappears. Is there a method to integrate the mask into the Shader Graph? Thank you.

mob-sakai commented 3 weeks ago

For now (v2.2.4), NO. Honestly, I'm not technically familiar with Shader Graph... But I do think supporting custom nodes would be a good idea. 👍

mob-sakai commented 3 weeks ago

I have done some research on ShaderGraph. I have created a generic SoftMask subgraph that will be released soon.

GID0317 commented 3 weeks ago

That was incredible! This is going to be a game-changer!

mob-sakai commented 3 weeks ago

Thanks. 👍 If you are interested you can try the pre-release version.

"com.coffee.softmask-for-ugui": "https://github.com/mob-sakai/SoftMaskForUGUI.git?path=Packages/src#develop",
mob-sakai commented 3 weeks ago

🎉 This issue has been resolved in version 2.3.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

mob-sakai commented 3 weeks ago

See https://github.com/mob-sakai/SoftMaskForUGUI?tab=readme-ov-file#usage-with-shadergraph

GID0317 commented 3 weeks ago

Hi, after testing the latest pre-release version of SoftMaskForUGUI (develop branch https://github.com/mob-sakai/SoftMaskForUGUI.git?path=Packages/src#develop), it appears that the Shader Graph support is listed as 0kb (And now the main release too). do you know how to fix this?

image

[Package Manager Window] Cannot import sample ShaderGraph Support: The path d:/unityproject/Project/Library/PackageCache/com.coffee.softmask-for-ugui/Samples~/ShaderGraph Support does not exist.

mob-sakai commented 3 weeks ago

Sorry, I'll fix it asap.

mob-sakai commented 3 weeks ago

Please try version 2.3.1

GID0317 commented 3 weeks ago

Thank you! Now it has been fixed in the version 2.3.1 image

GID0317 commented 3 weeks ago

It seems I've encountered a bug after testing. it appears that the bug only occurs when using the Soft Masking mode, which sometimes causes an unknown square to mask some sides of the image that we want to mask. Masking mode: Soft Masking UIDefault (SoftMaskable):

Custom ShaderGraph shader:

The other mode appears to be normal. Masking mode: Anti Aliasing

Masking mode: Normal

I have already tried testing it on the new scene, and the bug appears there as well, but it's not as noticeable as in the current scene I'm using.

mob-sakai commented 3 weeks ago

Thank you. Let's discuss in another issue. #191