Compare commits

...

10 Commits

Author SHA1 Message Date
semantic-release-bot b2d70af9c3 chore(release): 5.2.3 [skip ci]
## [5.2.3](https://github.com/mob-sakai/UIEffect/compare/5.2.2...5.2.3) (2025-01-23)

### Bug Fixes

* `SamplingFilter.None` now correctly respects the sampling scale setting ([bc1578b](https://github.com/mob-sakai/UIEffect/commit/bc1578b0ca91b830b976bf200d387d0ac6963ae6))
* fix the shadow mode inspector in editor ([da53585](https://github.com/mob-sakai/UIEffect/commit/da535854ccbeeb98b2556423425d39058bd5f479))
* UIEffect may not work correctly when using `FallbackAtlas` with TextMeshProUGUI ([d3779f9](https://github.com/mob-sakai/UIEffect/commit/d3779f9f57d0410fa4526527ebed30885bfbc2dd)), closes [#298](https://github.com/mob-sakai/UIEffect/issues/298)
2025-01-23 10:17:55 +00:00
mob-sakai da535854cc fix: fix the shadow mode inspector in editor 2025-01-23 16:29:10 +09:00
mob-sakai bc1578b0ca fix: SamplingFilter.None now correctly respects the sampling scale setting 2025-01-23 16:29:10 +09:00
mob-sakai d3779f9f57 fix: UIEffect may not work correctly when using FallbackAtlas with TextMeshProUGUI
close #298
2025-01-23 16:13:10 +09:00
semantic-release-bot 213daa85e9 chore(release): 5.2.2 [skip ci]
## [5.2.2](https://github.com/mob-sakai/UIEffect/compare/5.2.1...5.2.2) (2025-01-18)

### Bug Fixes

* in Unity 6, `Shadow Color` has no effect on TextMeshPro ([6e4d4ab](https://github.com/mob-sakai/UIEffect/commit/6e4d4ab03db786e4c28d0f2c57d9e58655c5d029)), closes [#297](https://github.com/mob-sakai/UIEffect/issues/297)
2025-01-18 08:24:10 +00:00
mob-sakai 6e4d4ab03d fix: in Unity 6, Shadow Color has no effect on TextMeshPro
Import `TextMeshPro Support` again.
close #297
2025-01-18 17:00:56 +09:00
semantic-release-bot 4222d72318 chore(release): 5.2.1 [skip ci]
## [5.2.1](https://github.com/mob-sakai/UIEffect/compare/5.2.0...5.2.1) (2025-01-14)

### Bug Fixes

* shadow color being transparent at maximum `Shadow Fade` ([1d849e5](https://github.com/mob-sakai/UIEffect/commit/1d849e54cb57218a67afc2f8ad36d345bfdd0f74)), closes [#296](https://github.com/mob-sakai/UIEffect/issues/296)
* TextMeshPro is not displayed in prefab mode ([2b44837](https://github.com/mob-sakai/UIEffect/commit/2b44837bb9c93e1cc817a2c1cd112b244cd09391)), closes [#295](https://github.com/mob-sakai/UIEffect/issues/295)
* TextMeshProUGUI disappears when the Y-axis scale is changed ([8159c09](https://github.com/mob-sakai/UIEffect/commit/8159c091e8a6805a7781046ae0f660a3be13862c)), closes [#295](https://github.com/mob-sakai/UIEffect/issues/295)
2025-01-14 11:46:54 +00:00
mob-sakai 8159c091e8 fix: TextMeshProUGUI disappears when the Y-axis scale is changed
close #295
2025-01-14 20:05:01 +09:00
mob-sakai 2b44837bb9 fix: TextMeshPro is not displayed in prefab mode
close #295
2025-01-14 19:58:26 +09:00
mob-sakai 1d849e54cb fix: shadow color being transparent at maximum Shadow Fade
close #296
2025-01-14 19:42:46 +09:00
12 changed files with 60 additions and 29 deletions
+25
View File
@@ -1,3 +1,28 @@
## [5.2.3](https://github.com/mob-sakai/UIEffect/compare/5.2.2...5.2.3) (2025-01-23)
### Bug Fixes
* `SamplingFilter.None` now correctly respects the sampling scale setting ([bc1578b](https://github.com/mob-sakai/UIEffect/commit/bc1578b0ca91b830b976bf200d387d0ac6963ae6))
* fix the shadow mode inspector in editor ([da53585](https://github.com/mob-sakai/UIEffect/commit/da535854ccbeeb98b2556423425d39058bd5f479))
* UIEffect may not work correctly when using `FallbackAtlas` with TextMeshProUGUI ([d3779f9](https://github.com/mob-sakai/UIEffect/commit/d3779f9f57d0410fa4526527ebed30885bfbc2dd)), closes [#298](https://github.com/mob-sakai/UIEffect/issues/298)
## [5.2.2](https://github.com/mob-sakai/UIEffect/compare/5.2.1...5.2.2) (2025-01-18)
### Bug Fixes
* in Unity 6, `Shadow Color` has no effect on TextMeshPro ([6e4d4ab](https://github.com/mob-sakai/UIEffect/commit/6e4d4ab03db786e4c28d0f2c57d9e58655c5d029)), closes [#297](https://github.com/mob-sakai/UIEffect/issues/297)
## [5.2.1](https://github.com/mob-sakai/UIEffect/compare/5.2.0...5.2.1) (2025-01-14)
### Bug Fixes
* shadow color being transparent at maximum `Shadow Fade` ([1d849e5](https://github.com/mob-sakai/UIEffect/commit/1d849e54cb57218a67afc2f8ad36d345bfdd0f74)), closes [#296](https://github.com/mob-sakai/UIEffect/issues/296)
* TextMeshPro is not displayed in prefab mode ([2b44837](https://github.com/mob-sakai/UIEffect/commit/2b44837bb9c93e1cc817a2c1cd112b244cd09391)), closes [#295](https://github.com/mob-sakai/UIEffect/issues/295)
* TextMeshProUGUI disappears when the Y-axis scale is changed ([8159c09](https://github.com/mob-sakai/UIEffect/commit/8159c091e8a6805a7781046ae0f660a3be13862c)), closes [#295](https://github.com/mob-sakai/UIEffect/issues/295)
# [5.2.0](https://github.com/mob-sakai/UIEffect/compare/5.1.0...5.2.0) (2025-01-07)
+7 -5
View File
@@ -256,6 +256,7 @@ namespace Coffee.UIEffects.Editors
EditorGUILayout.Slider(_shadowDistanceX, 0, 1, "Reflection");
EditorGUILayout.PropertyField(_shadowDistanceY, EditorGUIUtility.TrTempContent("Offset"));
EditorGUILayout.PropertyField(_shadowMirrorScale);
EditorGUILayout.PropertyField(_shadowFade);
}
else
{
@@ -267,13 +268,14 @@ namespace Coffee.UIEffects.Editors
EditorGUILayout.PropertyField(_shadowDistance);
EditorGUILayout.PropertyField(_shadowIteration);
prevColorFilter = (ColorFilter)_shadowColorFilter.intValue;
EditorGUILayout.PropertyField(_shadowColorFilter);
DrawColor(_shadowColorFilter, _shadowColor, prevColorFilter, false);
EditorGUILayout.PropertyField(_shadowColorGlow);
EditorGUILayout.PropertyField(_shadowFade);
}
EditorGUILayout.PropertyField(_shadowColorFilter);
DrawColorPickerField(_shadowColor, false);
EditorGUILayout.PropertyField(_shadowColorGlow);
EditorGUILayout.PropertyField(_shadowFade);
// Shadow blur intensity
switch ((SamplingFilter)_samplingFilter.intValue)
{
case SamplingFilter.BlurFast:
+1 -3
View File
@@ -290,9 +290,7 @@ namespace Coffee.UIEffects
}
}
public override float actualSamplingScale => samplingFilter != SamplingFilter.None
? Mathf.Clamp(m_SamplingScale, 0.01f, 100)
: 1;
public override float actualSamplingScale => Mathf.Clamp(m_SamplingScale, 0.01f, 100);
public override bool canModifyShape => m_AllowToModifyMeshShape;
+8 -16
View File
@@ -56,7 +56,7 @@ namespace Coffee.UIEffects
if (graphic is TextMeshProUGUI)
{
_prevLossyScaleY = transform.lossyScale.y;
UIExtraCallbacks.onAfterCanvasRebuild += CheckSDFScaleForTMP;
Canvas.willRenderCanvases += CheckSDFScaleForTMP;
UIExtraCallbacks.onScreenSizeChanged += SetVerticesDirtyForTMP;
}
#endif
@@ -69,8 +69,8 @@ namespace Coffee.UIEffects
protected override void OnDisable()
{
#if TMP_ENABLE
Canvas.willRenderCanvases -= CheckSDFScaleForTMP;
UIExtraCallbacks.onScreenSizeChanged -= SetVerticesDirtyForTMP;
UIExtraCallbacks.onAfterCanvasRebuild -= CheckSDFScaleForTMP;
#endif
MaterialRepository.Release(ref _material);
@@ -164,11 +164,6 @@ namespace Coffee.UIEffects
if (isActiveAndEnabled)
{
OnTMPChanged(textMeshProUGUI);
var canvas = graphic.canvas;
if (canvas && graphic.isActiveAndEnabled)
{
canvas.additionalShaderChannels |= AdditionalCanvasShaderChannels.TexCoord2;
}
}
else if (0 < textMeshProUGUI.textInfo?.meshInfo?.Length
&& 0 < textMeshProUGUI.textInfo.meshInfo[0].vertexCount)
@@ -181,11 +176,6 @@ namespace Coffee.UIEffects
if (graphic)
{
graphic.SetVerticesDirty();
var canvas = graphic.canvas;
if (canvas && graphic.isActiveAndEnabled)
{
canvas.additionalShaderChannels |= AdditionalCanvasShaderChannels.TexCoord1;
}
}
}
@@ -268,7 +258,7 @@ namespace Coffee.UIEffects
}
else if (i - 1 < subMeshes.Count)
{
var subMeshUI = GetSubMeshUI(subMeshes, meshInfo.material);
var subMeshUI = GetSubMeshUI(subMeshes, meshInfo.material, i - 1);
if (!target || !subMeshUI) break;
var replica = subMeshUI.GetOrAddComponent<UIEffectReplica>();
@@ -295,11 +285,13 @@ namespace Coffee.UIEffects
s_Mesh.Clear(false);
}
private static TMP_SubMeshUI GetSubMeshUI(List<TMP_SubMeshUI> subMeshes, Material material)
private static TMP_SubMeshUI GetSubMeshUI(List<TMP_SubMeshUI> subMeshes, Material material, int start)
{
for (var j = 0; j < subMeshes.Count; j++)
var count = subMeshes.Count;
for (var j = 0; j < count; j++)
{
if (subMeshes[j].sharedMaterial == material) return subMeshes[j];
var s = subMeshes[(j + start + count) % count];
if (s.sharedMaterial == material) return s;
}
return null;
+1 -3
View File
@@ -54,9 +54,7 @@ namespace Coffee.UIEffects
}
}
public override float actualSamplingScale => target && target.samplingFilter != SamplingFilter.None
? Mathf.Clamp(m_SamplingScale, 0.01f, 100)
: 1;
public override float actualSamplingScale => Mathf.Clamp(m_SamplingScale, 0.01f, 100);
public override bool canModifyShape => m_AllowToModifyMeshShape;
@@ -65,6 +65,12 @@ namespace Coffee.UIEffects
UIVertexUtil.onLerpVertex = s_OnLerpVertex;
ShadowUtil.onMarkAsShadow = s_OnMarkAsShadow;
UIEffectContext.onModifyVertex = s_OnModifyVertex;
var canvas = graphic.canvas;
if (canvas)
{
canvas.additionalShaderChannels |= AdditionalCanvasShaderChannels.TexCoord1;
}
}
private static readonly Func<UIVertex, UIVertex, UIVertex, float, UIVertex> s_OnLerpVertex =
@@ -121,6 +127,12 @@ namespace Coffee.UIEffects
UIVertexUtil.onLerpVertex = s_OnLerpVertex;
ShadowUtil.onMarkAsShadow = s_OnMarkAsShadow;
UIEffectContext.onModifyVertex = s_OnModifyVertex;
var canvas = graphic.canvas;
if (canvas)
{
canvas.additionalShaderChannels |= AdditionalCanvasShaderChannels.TexCoord2;
}
}
private static readonly Func<UIVertex, UIVertex, UIVertex, float, UIVertex> s_OnLerpVertex =
+1 -1
View File
@@ -21,8 +21,8 @@ namespace Coffee.UIEffects
for (var i = 0; i < iteration; i++)
{
d += distance / (i + 1);
a *= 0.75f;
ApplyShadow(verts, vectors, ref start, ref end, d, a);
a *= 0.75f;
}
// Mark as shadow vertices.
@@ -65,6 +65,7 @@ SubShader {
#pragma shader_feature_local_fragment _ SAMPLING_BLUR_FAST SAMPLING_BLUR_MEDIUM SAMPLING_BLUR_DETAIL SAMPLING_PIXELATION SAMPLING_RGB_SHIFT SAMPLING_EDGE_LUMINANCE SAMPLING_EDGE_ALPHA
#pragma shader_feature_local_fragment _ TRANSITION_FADE TRANSITION_CUTOFF TRANSITION_DISSOLVE TRANSITION_SHINY TRANSITION_MASK TRANSITION_MELT TRANSITION_BURN
#pragma shader_feature_local_fragment _ TRANSITION_COLOR_MULTIPLY TRANSITION_COLOR_ADDITIVE TRANSITION_COLOR_SUBTRACTIVE TRANSITION_COLOR_REPLACE TRANSITION_COLOR_MULTIPLY_LUMINANCE TRANSITION_COLOR_MULTIPLY_ADDITIVE TRANSITION_COLOR_HSV_MODIFIER TRANSITION_COLOR_CONTRAST
#pragma shader_feature_local_fragment _ SHADOW_COLOR_MULTIPLY SHADOW_COLOR_ADDITIVE SHADOW_COLOR_SUBTRACTIVE SHADOW_COLOR_REPLACE SHADOW_COLOR_MULTIPLY_LUMINANCE SHADOW_COLOR_MULTIPLY_ADDITIVE SHADOW_COLOR_HSV_MODIFIER SHADOW_COLOR_CONTRAST
#pragma shader_feature_local_fragment _ TARGET_HUE TARGET_LUMINANCE
// ==== UIEFFECT END ====
@@ -64,6 +64,7 @@ SubShader{
#pragma shader_feature_local_fragment _ SAMPLING_BLUR_FAST SAMPLING_BLUR_MEDIUM SAMPLING_BLUR_DETAIL SAMPLING_PIXELATION SAMPLING_RGB_SHIFT SAMPLING_EDGE_LUMINANCE SAMPLING_EDGE_ALPHA
#pragma shader_feature_local_fragment _ TRANSITION_FADE TRANSITION_CUTOFF TRANSITION_DISSOLVE TRANSITION_SHINY TRANSITION_MASK TRANSITION_MELT TRANSITION_BURN
#pragma shader_feature_local_fragment _ TRANSITION_COLOR_MULTIPLY TRANSITION_COLOR_ADDITIVE TRANSITION_COLOR_SUBTRACTIVE TRANSITION_COLOR_REPLACE TRANSITION_COLOR_MULTIPLY_LUMINANCE TRANSITION_COLOR_MULTIPLY_ADDITIVE TRANSITION_COLOR_HSV_MODIFIER TRANSITION_COLOR_CONTRAST
#pragma shader_feature_local_fragment _ SHADOW_COLOR_MULTIPLY SHADOW_COLOR_ADDITIVE SHADOW_COLOR_SUBTRACTIVE SHADOW_COLOR_REPLACE SHADOW_COLOR_MULTIPLY_LUMINANCE SHADOW_COLOR_MULTIPLY_ADDITIVE SHADOW_COLOR_HSV_MODIFIER SHADOW_COLOR_CONTRAST
#pragma shader_feature_local_fragment _ TARGET_HUE TARGET_LUMINANCE
// ==== UIEFFECT END ====
@@ -103,6 +103,7 @@ SubShader {
#pragma shader_feature_local_fragment _ SAMPLING_BLUR_FAST SAMPLING_BLUR_MEDIUM SAMPLING_BLUR_DETAIL SAMPLING_PIXELATION SAMPLING_RGB_SHIFT SAMPLING_EDGE_LUMINANCE SAMPLING_EDGE_ALPHA
#pragma shader_feature_local_fragment _ TRANSITION_FADE TRANSITION_CUTOFF TRANSITION_DISSOLVE TRANSITION_SHINY TRANSITION_MASK TRANSITION_MELT TRANSITION_BURN
#pragma shader_feature_local_fragment _ TRANSITION_COLOR_MULTIPLY TRANSITION_COLOR_ADDITIVE TRANSITION_COLOR_SUBTRACTIVE TRANSITION_COLOR_REPLACE TRANSITION_COLOR_MULTIPLY_LUMINANCE TRANSITION_COLOR_MULTIPLY_ADDITIVE TRANSITION_COLOR_HSV_MODIFIER TRANSITION_COLOR_CONTRAST
#pragma shader_feature_local_fragment _ SHADOW_COLOR_MULTIPLY SHADOW_COLOR_ADDITIVE SHADOW_COLOR_SUBTRACTIVE SHADOW_COLOR_REPLACE SHADOW_COLOR_MULTIPLY_LUMINANCE SHADOW_COLOR_MULTIPLY_ADDITIVE SHADOW_COLOR_HSV_MODIFIER SHADOW_COLOR_CONTRAST
#pragma shader_feature_local_fragment _ TARGET_HUE TARGET_LUMINANCE
// ==== UIEFFECT END ====
@@ -135,6 +135,7 @@ SubShader {
#pragma shader_feature_local_fragment _ SAMPLING_BLUR_FAST SAMPLING_BLUR_MEDIUM SAMPLING_BLUR_DETAIL SAMPLING_PIXELATION SAMPLING_RGB_SHIFT SAMPLING_EDGE_LUMINANCE SAMPLING_EDGE_ALPHA
#pragma shader_feature_local_fragment _ TRANSITION_FADE TRANSITION_CUTOFF TRANSITION_DISSOLVE TRANSITION_SHINY TRANSITION_MASK TRANSITION_MELT TRANSITION_BURN
#pragma shader_feature_local_fragment _ TRANSITION_COLOR_MULTIPLY TRANSITION_COLOR_ADDITIVE TRANSITION_COLOR_SUBTRACTIVE TRANSITION_COLOR_REPLACE TRANSITION_COLOR_MULTIPLY_LUMINANCE TRANSITION_COLOR_MULTIPLY_ADDITIVE TRANSITION_COLOR_HSV_MODIFIER TRANSITION_COLOR_CONTRAST
#pragma shader_feature_local_fragment _ SHADOW_COLOR_MULTIPLY SHADOW_COLOR_ADDITIVE SHADOW_COLOR_SUBTRACTIVE SHADOW_COLOR_REPLACE SHADOW_COLOR_MULTIPLY_LUMINANCE SHADOW_COLOR_MULTIPLY_ADDITIVE SHADOW_COLOR_HSV_MODIFIER SHADOW_COLOR_CONTRAST
#pragma shader_feature_local_fragment _ TARGET_HUE TARGET_LUMINANCE
// ==== UIEFFECT END ====
+1 -1
View File
@@ -2,7 +2,7 @@
"name": "com.coffee.ui-effect",
"displayName": "UI Effect",
"description": "UIEffect is an open-source package that allows you to intuitively apply rich UI effects directly from the Inspector or via code.\nCombine various filters, such as grayscale, blur, and dissolve, to decorate your UI with a unique visual style!",
"version": "5.2.0",
"version": "5.2.3",
"unity": "2020.3",
"license": "MIT",
"repository": {