Releases: mob-sakai/SoftMaskForUGUI
3.0.1
3.0.0
3.0.0 (2024-12-01)
Bug Fixes
- fix anti-aliasing issues (e68ee7b)
Features
- add 'SOFTMASKABLE' shader feature to improve shader build (eec3212)
- asset upgrade system 'SOFTMASKABLE' shader feature (d36f932)
- MaskingShape components always use stencil mask (6c6ac59), closes #203 #209
- strip shaders using ShaderVariantCollection instead of 'Always Include Shaders' (5f4c435), closes #211
- update asset upgrade system to unregister always included shaders (906bdb6)
BREAKING CHANGES
- SoftMaskable shaders now require the
SOFTMASKABLE
shader feature.
Please upgrade assets fromProject Settings > UI > Soft Mask
or refer to the 'README > Usage with Your Custom Shaders' section to manually update your shaders.
🎮 Demo
⚙ Installation
This package requires Unity 2019.4 or later.
Install via OpenUPM
openupm add com.softmask-for-ugui
# or, for a specific version
openupm add com.softmask-for-ugui@3.0.0
Install via UPM
"com.coffee.softmask-for-ugui": "https://github.com/mob-sakai/SoftMaskForUGUI.git?path=Packages/src",
Import Additional Resources
Additional resources can be imported to extend functionality.
🔄 Upgrade All Assets For V3
If you are currently using SoftMaskForUGUI v1.x/v2.x, the following breaking changes are included when upgrading to v3:
-
(From v1) API changes: Some APIs are obsolete.
SoftMask.alpha
: UseGraphic.color.a
instead.SoftMask.softness
: UseSoftMask.softnessRange
instead.SoftMask.partOfParent
: UseMaskingShape
component instead.SoftMask.ignoreParent
: Removed.SoftMask.ignoreSelfGraphic
: Removed.SoftMask.ignoreSelfStencil
: Removed.SoftMaskable.useStencil
: Removed.SoftMaskable.raycastFilter
: UseSoftMask.alphaHitTest
instead.SoftMaskable.maskInteraction
: If you want to use as inverse mask, useMaskingShape
component and
MaskingMethod=Subtract
.
-
(From v1)
SoftMaskable
component:SoftMaskable
component is no longer required to be added explicitly.- It will be added automatically at runtime as needed.
-
(From v1)
SoftMaskable
shader:SoftMask()
function has been updated with additional arguments.// Before color.a *= SoftMask(IN.vertex, IN.worldPosition); // After color.a *= SoftMask(IN.vertex, IN.worldPosition, color.a);
-
(From v2)
SoftMaskable
shader:SOFTMASKABLE
shader feature is now required.#pragma shader_feature_local _ SOFTMASKABLE
-
If you are installing via git URL, add
?path=Packages/src
.// v1/v2 "com.coffee.softmask-for-ugui": "https://github.com/mob-sakai/SoftMaskForUGUI.git", // v3 "com.coffee.softmask-for-ugui": "https://github.com/mob-sakai/SoftMaskForUGUI.git?path=Packages/src",
-
Hidden/UI/SoftMask
,Hidden/UI/TerminalMaskingShape
andSoftMaskable
shader variants used at runtime must be
registered in the Project Settings.- In v2, the SoftMaskable shaders were included in the "Always Included Shaders", but in v3, they must be registered
automatically or manually. - You can strip unnecessary shader variants to reduce build time and file size.
- If
SoftMask
does not display correctly in the player, open/play the scenes or prefabs in the editor. The shader
variants will be automatically registered.
- In v2, the SoftMaskable shaders were included in the "Always Included Shaders", but in v3, they must be registered
To apply these changes automatically, please follow the steps below:
-
Click
Edit > Project Settings
to open the Project Settings window and selectUI > SoftMask
category. -
Click
Upgrade All Assets For V3
to upgrade the assets.
🚀 Usage
Getting Started
v2.4.6
v2.4.5
v2.4.4
v2.4.3
v2.4.2
v2.4.1
2.4.1 (2024-11-14)
Bug Fixes
v2.4.0
2.4.0 (2024-11-01)
Bug Fixes
- argumentException: RenderTextureDesc width must be greater than zero when setting the Down Sampling Rate to X8. (3ffe109), closes #204
- compile error in UniversalRP 16 (Unity 2023.2) (80413fc), closes #206
Features
v2.3.8
2.3.8 (2024-09-29)
Bug Fixes
- if
UniversalRenderPipelineAsset.renderScale
is not 1, soft masking will not be rendered correctly (6e5a7f9), closes #194 - in URP, dynamic resolution does not work when render scale is close to 1 (afed40a)
- recreates ProjectSettings scriptable object when the project is pulled from GitHub (9f6ea22), closes #200
- when using dynamic resolution, soft masking will not be rendered correctly (5100e3f), closes #199