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

Shader Graph Support #190

Closed
GID0317 opened this issue Sep 1, 2024 · 12 comments
Closed

Shader Graph Support #190

GID0317 opened this issue Sep 1, 2024 · 12 comments
Assignees
Labels
enhancement New feature or request released

Comments

@GID0317
Copy link

GID0317 commented Sep 1, 2024

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.

@GID0317 GID0317 added the question Further information is requested label Sep 1, 2024
@mob-sakai
Copy link
Owner

mob-sakai commented Sep 4, 2024

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 added a commit that referenced this issue Sep 4, 2024
Unity 2023.2/600.0+ is required.

close #190
@mob-sakai
Copy link
Owner

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

@mob-sakai mob-sakai added enhancement New feature or request and removed question Further information is requested labels Sep 4, 2024
@mob-sakai mob-sakai changed the title Is the version 2 support Unity URP Shader Graph? Shader Graph Support Sep 4, 2024
mob-sakai added a commit that referenced this issue Sep 4, 2024
Unity 2023.2/600.0+ is required.

close #190
github-actions bot pushed a commit that referenced this issue Sep 4, 2024
# [2.3.0](v2.2.4...v2.3.0) (2024-09-04)

### Bug Fixes

* `MaskingShape.maskingMethod = Subtract` is not working correctly ([56e1262](56e1262))
* nested `MaskingShape` is not working correctly ([b1331cf](b1331cf)), closes [#189](#189)
* when `UseStencilOutsideScreen = true`, objects inside `SoftMask` are not batched in the editor ([21dfae7](21dfae7)), closes [#188](#188)

### Features

* ShaderGraph support ([c4ebe58](c4ebe58)), closes [#190](#190)
github-actions bot pushed a commit that referenced this issue Sep 4, 2024
# [2.3.0](v2.2.4...v2.3.0) (2024-09-04)

### Bug Fixes

* `MaskingShape.maskingMethod = Subtract` is not working correctly ([56e1262](56e1262))
* nested `MaskingShape` is not working correctly ([b1331cf](b1331cf)), closes [#189](#189)
* when `UseStencilOutsideScreen = true`, objects inside `SoftMask` are not batched in the editor ([21dfae7](21dfae7)), closes [#188](#188)

### Features

* ShaderGraph support ([c4ebe58](c4ebe58)), closes [#190](#190)
@GID0317
Copy link
Author

GID0317 commented Sep 4, 2024

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

Repository owner deleted a comment from github-actions bot Sep 4, 2024
@mob-sakai mob-sakai removed the released label Sep 4, 2024
@mob-sakai
Copy link
Owner

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",

github-actions bot pushed a commit that referenced this issue Sep 5, 2024
# [2.3.0](v2.2.4...v2.3.0) (2024-09-05)

### Bug Fixes

* `MaskingShape.maskingMethod = Subtract` is not working correctly ([56e1262](56e1262))
* nested `MaskingShape` is not working correctly ([b1331cf](b1331cf)), closes [#189](#189)
* when `UseStencilOutsideScreen = true`, objects inside `SoftMask` are not batched in the editor ([21dfae7](21dfae7)), closes [#188](#188)

### Features

* ShaderGraph support ([c4ebe58](c4ebe58)), closes [#190](#190)
mob-sakai pushed a commit that referenced this issue Sep 5, 2024
# [2.3.0](v2.2.4...v2.3.0) (2024-09-05)

### Bug Fixes

* `MaskingShape.maskingMethod = Subtract` is not working correctly ([56e1262](56e1262))
* nested `MaskingShape` is not working correctly ([b1331cf](b1331cf)), closes [#189](#189)
* when `UseStencilOutsideScreen = true`, objects inside `SoftMask` are not batched in the editor ([21dfae7](21dfae7)), closes [#188](#188)

### Features

* ShaderGraph support ([c4ebe58](c4ebe58)), closes [#190](#190)
@mob-sakai
Copy link
Owner

🎉 This issue has been resolved in version 2.3.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@mob-sakai
Copy link
Owner

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

@GID0317
Copy link
Author

GID0317 commented Sep 5, 2024

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
Copy link
Owner

Sorry, I'll fix it asap.

github-actions bot pushed a commit that referenced this issue Sep 5, 2024
# [3.0.0](v2.3.0...v3.0.0) (2024-09-05)

### Bug Fixes

* `MaskingShape.maskingMethod = Subtract` is not working correctly ([cc77830](cc77830))
* `Stereo Enabled` option in preferences does not work ([388a73f](388a73f))
* fix a major performance regression where if you had a lot of softmaskable components (even if the parent canvas was in-active) it would eat over 20ms doing a certain editor-only function ([2d793c4](2d793c4))
* fix broken anchor on README.md ([1e53068](1e53068))
* fix null exception ([23b0b2c](23b0b2c))
* fix soft-maskable shaders for TextMeshPro v2.0/v2.1/v2.2/v3.0 ([83eacec](83eacec))
* fix upgrading asset system (v1 to v2) ([3cdcc86](3cdcc86))
* flashing when SoftnessRange is changed in inspector ([12f81cf](12f81cf))
* if no `Canvas` in the parents of the `SoftMask`, error occurred ([710d2cf](710d2cf)), closes [#182](#182)
* in linear color mode, `TextMeshProUGUI` appeared darker ([780beb1](780beb1)), closes [#187](#187)
* nested `MaskingShape` is not working correctly ([560f6a3](560f6a3)), closes [#189](#189)
* placing a SoftMaskable object outside of a SoftMask makes the object invisible ([096aa69](096aa69)), closes [#180](#180)
* ShaderGraph support is not included ([7df8b2b](7df8b2b))
* shaders for SoftMask are not automatically included ([0c22da7](0c22da7)), closes [#177](#177) [#178](#178)
* soft mask buffer is fliped on UNITY_UV_STARTS_AT_TOP devices ([b44edc3](b44edc3)), closes [#179](#179)
* soft mask is upside down on some devices ([e16a161](e16a161)), closes [#185](#185)
* soft mask is upside down on some devices (refactor) ([c9db361](c9db361))
* soft masked image flickers or disappears when resizing canvas in editor ([767bb5b](767bb5b)), closes [#184](#184)
* softmask-buffer is cleared when TMPSubMeshUI is activated via EditorGUI ([5d86379](5d86379)), closes [#180](#180)
* stencil masking does not working correctly when `SoftMask` component is placed under `Mask` component ([b66fe86](b66fe86)), closes [#183](#183)
* support 'Apply display rotation during rendering' for Vulkan (experimental) ([fe586dc](fe586dc)), closes [#171](#171)
* when `UseStencilOutsideScreen = true`, objects inside `SoftMask` are not batched in the editor ([8b93959](8b93959)), closes [#188](#188)
* when changing resolution, display, or screen orientation, soft-masking do not work properly ([dee7271](dee7271))

### Features

* 'SoftMask.partOfParent' is now obsolete. Please use 'MaskingShape' component instead. ([380cd32](380cd32))
* (editor) use stencil outside screen in scene view for development ([611d92f](611d92f))
* add 'AntiAliasing' masking mode. This mode suppresses stencil-derived mask aliasing without using RenderTexture. ([fe532c6](fe532c6))
* add 'Hide Generated Components' option in project settings ([0fc9aeb](0fc9aeb))
* add 'SoftMask.softMaskingRange' option ([1acb954](1acb954))
* add a help box to the auto-generated object inspector ([5560355](5560355)), closes [#175](#175)
* add asset modify system to migrate from v1 to v2 ([d0e9194](d0e9194))
* add explicit dependencies ([403e834](403e834))
* add project settings for SoftMask ([50e9e0e](50e9e0e))
* add soft-maskable shaders for TextMeshPro v3.2/v4.0 ([679acc4](679acc4))
* add stereo mode to shader ([48b2be1](48b2be1))
* exclude unused shader variants from the build (option) ([0630a3c](0630a3c))
* revive `SoftMask.alpha` ([b062edf](b062edf)), closes [#172](#172)
* ShaderGraph support ([f21f2ff](f21f2ff)), closes [#190](#190)
* softmask buffers are now baked considering `Graphic.color.a` ([484adaa](484adaa))
* support for shaders with `(SoftMaskable)` in the name except at the end ([cd25357](cd25357))
* support uGUI 2.0.0 ([c480cef](c480cef))

### BREAKING CHANGES

* The implementation way of the 'SoftMaskable' shader has been changed. Please refer to the "Migrating from v1 to v2" section in the Readme for details.
github-actions bot pushed a commit that referenced this issue Sep 5, 2024
# [3.0.0](v2.3.0...v3.0.0) (2024-09-05)

### Bug Fixes

* `MaskingShape.maskingMethod = Subtract` is not working correctly ([cc77830](cc77830))
* `Stereo Enabled` option in preferences does not work ([388a73f](388a73f))
* fix a major performance regression where if you had a lot of softmaskable components (even if the parent canvas was in-active) it would eat over 20ms doing a certain editor-only function ([2d793c4](2d793c4))
* fix broken anchor on README.md ([1e53068](1e53068))
* fix null exception ([23b0b2c](23b0b2c))
* fix soft-maskable shaders for TextMeshPro v2.0/v2.1/v2.2/v3.0 ([83eacec](83eacec))
* fix upgrading asset system (v1 to v2) ([3cdcc86](3cdcc86))
* flashing when SoftnessRange is changed in inspector ([12f81cf](12f81cf))
* if no `Canvas` in the parents of the `SoftMask`, error occurred ([710d2cf](710d2cf)), closes [#182](#182)
* in linear color mode, `TextMeshProUGUI` appeared darker ([780beb1](780beb1)), closes [#187](#187)
* nested `MaskingShape` is not working correctly ([560f6a3](560f6a3)), closes [#189](#189)
* placing a SoftMaskable object outside of a SoftMask makes the object invisible ([096aa69](096aa69)), closes [#180](#180)
* ShaderGraph support is not included ([7df8b2b](7df8b2b))
* shaders for SoftMask are not automatically included ([0c22da7](0c22da7)), closes [#177](#177) [#178](#178)
* soft mask buffer is fliped on UNITY_UV_STARTS_AT_TOP devices ([b44edc3](b44edc3)), closes [#179](#179)
* soft mask is upside down on some devices ([e16a161](e16a161)), closes [#185](#185)
* soft mask is upside down on some devices (refactor) ([c9db361](c9db361))
* soft masked image flickers or disappears when resizing canvas in editor ([767bb5b](767bb5b)), closes [#184](#184)
* softmask-buffer is cleared when TMPSubMeshUI is activated via EditorGUI ([5d86379](5d86379)), closes [#180](#180)
* stencil masking does not working correctly when `SoftMask` component is placed under `Mask` component ([b66fe86](b66fe86)), closes [#183](#183)
* support 'Apply display rotation during rendering' for Vulkan (experimental) ([fe586dc](fe586dc)), closes [#171](#171)
* when `UseStencilOutsideScreen = true`, objects inside `SoftMask` are not batched in the editor ([8b93959](8b93959)), closes [#188](#188)
* when changing resolution, display, or screen orientation, soft-masking do not work properly ([dee7271](dee7271))

### Features

* 'SoftMask.partOfParent' is now obsolete. Please use 'MaskingShape' component instead. ([380cd32](380cd32))
* (editor) use stencil outside screen in scene view for development ([611d92f](611d92f))
* add 'AntiAliasing' masking mode. This mode suppresses stencil-derived mask aliasing without using RenderTexture. ([fe532c6](fe532c6))
* add 'Hide Generated Components' option in project settings ([0fc9aeb](0fc9aeb))
* add 'SoftMask.softMaskingRange' option ([1acb954](1acb954))
* add a help box to the auto-generated object inspector ([5560355](5560355)), closes [#175](#175)
* add asset modify system to migrate from v1 to v2 ([d0e9194](d0e9194))
* add explicit dependencies ([403e834](403e834))
* add project settings for SoftMask ([50e9e0e](50e9e0e))
* add soft-maskable shaders for TextMeshPro v3.2/v4.0 ([679acc4](679acc4))
* add stereo mode to shader ([48b2be1](48b2be1))
* exclude unused shader variants from the build (option) ([0630a3c](0630a3c))
* revive `SoftMask.alpha` ([b062edf](b062edf)), closes [#172](#172)
* ShaderGraph support ([f21f2ff](f21f2ff)), closes [#190](#190)
* softmask buffers are now baked considering `Graphic.color.a` ([484adaa](484adaa))
* support for shaders with `(SoftMaskable)` in the name except at the end ([cd25357](cd25357))
* support uGUI 2.0.0 ([c480cef](c480cef))

### BREAKING CHANGES

* The implementation way of the 'SoftMaskable' shader has been changed. Please refer to the "Migrating from v1 to v2" section in the Readme for details.
Repository owner deleted a comment from github-actions bot Sep 5, 2024
@mob-sakai
Copy link
Owner

Please try version 2.3.1

@GID0317
Copy link
Author

GID0317 commented Sep 5, 2024

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

@GID0317
Copy link
Author

GID0317 commented Sep 5, 2024

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
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request released
Projects
None yet
Development

No branches or pull requests

2 participants