Compare commits

..

No commits in common. "main" and "1.0.0" have entirely different histories.
main ... 1.0.0

5 changed files with 6 additions and 42 deletions

View File

@ -1,18 +1,3 @@
## [1.0.2](https://github.com/mob-sakai/SoftMaskForUGUI/compare/1.0.1...1.0.2) (2022-05-15)
### Bug Fixes
* support TextMeshPro v2 or later ([c85409e](https://github.com/mob-sakai/SoftMaskForUGUI/commit/c85409e56ff09607244061c59518f5d1f460a918))
## [1.0.1](https://github.com/mob-sakai/SoftMaskForUGUI/compare/1.0.0...1.0.1) (2022-05-15)
### Bug Fixes
* applied a workaround to fix a Microsoft HLSL compiler issue ([50c41f2](https://github.com/mob-sakai/SoftMaskForUGUI/commit/50c41f29ccc9b70acdd7f15490debd8eacf5a102)), closes [#131](https://github.com/mob-sakai/SoftMaskForUGUI/issues/131)
* fixed shader compilation in some platforms ([40b450b](https://github.com/mob-sakai/SoftMaskForUGUI/commit/40b450ba24e77c34c97fe8411f7b0b1dd103d487))
# [1.0.0](https://github.com/mob-sakai/SoftMaskForUGUI/compare/0.9.1...1.0.0) (2021-02-24)

View File

@ -124,13 +124,8 @@ SubShader {
#include "UnityCG.cginc"
#include "UnityUI.cginc"
#if UNITY_VERSION < 201910
#include "Assets/TextMesh Pro/Resources/Shaders/TMPro_Properties.cginc"
#include "Assets/TextMesh Pro/Resources/Shaders/TMPro.cginc"
#else
#include "Assets/TextMesh Pro/Shaders/TMPro_Properties.cginc"
#include "Assets/TextMesh Pro/Shaders/TMPro.cginc"
#endif
#include "Packages/com.coffee.softmask-for-ugui/Shaders/SoftMask.cginc"
#pragma shader_feature __ SOFTMASK_EDITOR

View File

@ -93,11 +93,7 @@ SubShader {
#include "UnityCG.cginc"
#include "UnityUI.cginc"
#if UNITY_VERSION < 201910
#include "Assets/TextMesh Pro/Resources/Shaders/TMPro_Properties.cginc"
#else
#include "Assets/TextMesh Pro/Shaders/TMPro_Properties.cginc"
#endif
#include "Packages/com.coffee.softmask-for-ugui/Shaders/SoftMask.cginc"
#pragma shader_feature __ SOFTMASK_EDITOR

View File

@ -7,21 +7,9 @@ float4x4 _GameVP;
float4x4 _GameTVP;
half4 _MaskInteraction;
float CustomStep(float a, float x)
{
return x >= a;
}
fixed Approximately(float4x4 a, float4x4 b)
{
float4x4 d = a - b;
d = float4x4(
abs(d[0]),
abs(d[1]),
abs(d[2]),
abs(d[3])
);
float4x4 d = abs(a - b);
return step(
max(d._m00,max(d._m01,max(d._m02,max(d._m03,
max(d._m10,max(d._m11,max(d._m12,max(d._m13,
@ -42,16 +30,16 @@ float SoftMaskInternal(float4 clipPos)
float4 cpos = mul(_GameTVP, mul(UNITY_MATRIX_M, wpos));
view = lerp(view, cpos.xy / cpos.w * 0.5 + 0.5, isSceneView);
#if UNITY_UV_STARTS_AT_TOP
view.y = lerp(view.y, 1 - view.y, CustomStep(0, _ProjectionParams.x));
view.y = lerp(view.y, 1 - view.y, step(0, _ProjectionParams.x));
#endif
#elif UNITY_UV_STARTS_AT_TOP
view.y = lerp(view.y, 1 - view.y, CustomStep(0, _ProjectionParams.x));
view.y = lerp(view.y, 1 - view.y, step(0, _ProjectionParams.x));
#endif
fixed4 mask = tex2D(_SoftMaskTex, view);
half4 alpha = saturate(lerp(fixed4(1, 1, 1, 1), lerp(mask, 1 - mask, _MaskInteraction - 1), _MaskInteraction));
#if SOFTMASK_EDITOR
alpha *= CustomStep(0, view.x) * CustomStep(view.x, 1) * CustomStep(0, view.y) * CustomStep(view.y, 1);
alpha *= step(0, view.x) * step(view.x, 1) * step(0, view.y) * step(view.y, 1);
#endif
return alpha.x * alpha.y * alpha.z * alpha.w;
@ -65,4 +53,4 @@ float SoftMaskInternal(float4 clipPos)
#define SoftMask(clipPos, worldPosition) SoftMaskInternal(clipPos)
#endif
#endif // UI_SOFTMASK_INCLUDED
#endif // UI_SOFTMASK_INCLUDED

View File

@ -2,7 +2,7 @@
"name": "com.coffee.softmask-for-ugui",
"displayName": "UI Soft Mask",
"description": "UI Soft Mask is a smooth masking component for Unity UI (uGUI) elements.\nBy using SoftMask instead of the default Mask component, you can beautifully represent the rounded edges of UI elements.",
"version": "1.0.2",
"version": "1.0.0",
"unity": "2017.1",
"license": "MIT",
"repository": {