Compare commits

..

10 Commits

Author SHA1 Message Date
semantic-release-bot dbdb99b52a chore(release): 5.6.3 [skip ci]
## [5.6.3](https://github.com/mob-sakai/UIEffect/compare/5.6.2...5.6.3) (2025-04-06)

### Bug Fixes

* fix a potential `ArgumentOutOfRangeException` that could occur when changing the FontAsset in TextMeshPro ([3b095bc](https://github.com/mob-sakai/UIEffect/commit/3b095bcebd8b1264c373b8b71c27d3c35f673f3b)), closes [#327](https://github.com/mob-sakai/UIEffect/issues/327)
2025-04-06 22:39:51 +00:00
mob-sakai 3b095bcebd fix: fix a potential ArgumentOutOfRangeException that could occur when changing the FontAsset in TextMeshPro
close #327
2025-04-07 07:39:18 +09:00
semantic-release-bot 2a900987f5 chore(release): 5.6.2 [skip ci]
## [5.6.2](https://github.com/mob-sakai/UIEffect/compare/5.6.1...5.6.2) (2025-04-04)

### Bug Fixes

* fix a potential `ArgumentOutOfRangeException` that could occur when changing the FontAsset in TextMeshPro ([909281c](https://github.com/mob-sakai/UIEffect/commit/909281c66b702d8497e9f847c91b688716b9c6a7)), closes [#327](https://github.com/mob-sakai/UIEffect/issues/327)
* Remove unnecessary vertex expansion ([974e3e8](https://github.com/mob-sakai/UIEffect/commit/974e3e8769d456c5cdd8eb1767a7cf57ab4d52fc))
* undo now works correctly after clicking the 'Clear' button in the inspector ([75ed355](https://github.com/mob-sakai/UIEffect/commit/75ed355e27faf8962390eb6788e1887ffd1b5f89))
2025-04-04 11:20:33 +00:00
mob-sakai 974e3e8769 fix: Remove unnecessary vertex expansion 2025-04-04 14:29:39 +09:00
mob-sakai 909281c66b fix: fix a potential ArgumentOutOfRangeException that could occur when changing the FontAsset in TextMeshPro
close #327
2025-04-04 13:56:00 +09:00
mob-sakai 75ed355e27 fix: undo now works correctly after clicking the 'Clear' button in the inspector 2025-04-04 13:55:51 +09:00
mob-sakai a0dd316df6 docs: update readme 2025-03-29 01:37:36 +09:00
semantic-release-bot 4f66bbfb4d chore(release): 5.6.1 [skip ci]
## [5.6.1](https://github.com/mob-sakai/UIEffect/compare/5.6.0...5.6.1) (2025-03-28)

### Bug Fixes

* changes were not correctly marked as dirty when loading presets ([76be0fc](https://github.com/mob-sakai/UIEffect/commit/76be0fc860c27b89235b7fb9a766dcc38b3d9924))
2025-03-28 11:18:28 +00:00
mob-sakai 91d5519356 docs: update docs 2025-03-28 20:17:37 +09:00
mob-sakai 76be0fc860 fix: changes were not correctly marked as dirty when loading presets 2025-03-28 20:17:36 +09:00
13 changed files with 6799 additions and 108 deletions
File diff suppressed because it is too large Load Diff
@@ -8,6 +8,24 @@ ShaderVariantCollection:
m_PrefabAsset: {fileID: 0}
m_Name: UIEffectShaderVariants
m_Shaders:
- first: {fileID: 4800000, guid: d1cb940e3804b4adcaf9b22083fadfad, type: 3}
second:
variants:
- keywords: SAMPLING_RGB_SHIFT TONE_RETRO TRANSITION_COLOR_MULTIPLY_ADDITIVE
TRANSITION_SHINY
passType: 0
- first: {fileID: 4800000, guid: 63a1dba10bff94661a909d63808a9a3b, type: 3}
second:
variants:
- keywords: SAMPLING_RGB_SHIFT TONE_RETRO TRANSITION_COLOR_MULTIPLY_ADDITIVE
TRANSITION_SHINY
passType: 0
- first: {fileID: 4800000, guid: e65241fa80a374114b3f55ed746c04d9, type: 3}
second:
variants:
- keywords: SAMPLING_RGB_SHIFT TONE_RETRO TRANSITION_COLOR_MULTIPLY_ADDITIVE
TRANSITION_SHINY
passType: 0
- first: {fileID: 4800000, guid: 935b7be1c88464d2eb87204fdfab5a38, type: 3}
second:
variants:
@@ -49,6 +67,9 @@ ShaderVariantCollection:
passType: 0
- keywords: GLOW_ON TRANSITION_COLOR_REPLACE TRANSITION_MELT UNDERLAY_ON
passType: 0
- keywords: SAMPLING_RGB_SHIFT TONE_RETRO TRANSITION_COLOR_MULTIPLY_ADDITIVE
TRANSITION_SHINY
passType: 0
- first: {fileID: 4800000, guid: 96246b1ead49a4c5a996fd477bc5a117, type: 3}
second:
variants:
@@ -66,6 +87,10 @@ ShaderVariantCollection:
passType: 0
- keywords: COLOR_MULTIPLY
passType: 0
- keywords: COLOR_MULTIPLY DETAIL_MASKING EDGE_COLOR_MULTIPLY_ADDITIVE EDGE_SHINY
SAMPLING_BLUR_FAST SHADOW_COLOR_REPLACE TARGET_HUE TONE_GRAYSCALE TRANSITION_COLOR_MULTIPLY_ADDITIVE
TRANSITION_DISSOLVE
passType: 0
- keywords: COLOR_MULTIPLY SHADOW_COLOR_REPLACE
passType: 0
- keywords: COLOR_MULTIPLY_ADDITIVE
@@ -133,10 +158,18 @@ ShaderVariantCollection:
passType: 0
- keywords: SAMPLING_PIXELATION TONE_RETRO UNITY_UI_CLIP_RECT
passType: 0
- keywords: SAMPLING_PIXELATION TRANSITION_COLOR_MULTIPLY TRANSITION_PATTERN
passType: 0
- keywords: SAMPLING_PIXELATION TRANSITION_COLOR_MULTIPLY_ADDITIVE TRANSITION_DISSOLVE
passType: 0
- keywords: SAMPLING_RGB_SHIFT
passType: 0
- keywords: SAMPLING_RGB_SHIFT TRANSITION_COLOR_MULTIPLY TRANSITION_PATTERN
passType: 0
- keywords: SHADOW_COLOR_REPLACE
passType: 0
- keywords: SHADOW_COLOR_REPLACE TRANSITION_COLOR_REPLACE TRANSITION_MELT
passType: 0
- keywords: TONE_GRAYSCALE
passType: 0
- keywords: TONE_NEGATIVE
@@ -177,6 +210,30 @@ ShaderVariantCollection:
passType: 0
- keywords: TRANSITION_FADE
passType: 0
- first: {fileID: 4800000, guid: 03ea49e29b5ad4fbe8e340af208fe8e7, type: 3}
second:
variants:
- keywords: SAMPLING_RGB_SHIFT TONE_RETRO TRANSITION_COLOR_MULTIPLY_ADDITIVE
TRANSITION_SHINY
passType: 0
- first: {fileID: 4800000, guid: 16f26337621974eaf998b9857bac39c6, type: 3}
second:
variants:
- keywords: SAMPLING_RGB_SHIFT TONE_RETRO TRANSITION_COLOR_MULTIPLY_ADDITIVE
TRANSITION_SHINY
passType: 0
- first: {fileID: 4800000, guid: 2c69b4dabb5c24ae99889f581c8b556a, type: 3}
second:
variants:
- keywords: SAMPLING_RGB_SHIFT TONE_RETRO TRANSITION_COLOR_MULTIPLY_ADDITIVE
TRANSITION_SHINY
passType: 0
- first: {fileID: 4800000, guid: 26b66f9b09b8d4ac6a2790c3fa8b21c1, type: 3}
second:
variants:
- keywords: SAMPLING_RGB_SHIFT TONE_RETRO TRANSITION_COLOR_MULTIPLY_ADDITIVE
TRANSITION_SHINY
passType: 0
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
+23
View File
@@ -1,3 +1,26 @@
## [5.6.3](https://github.com/mob-sakai/UIEffect/compare/5.6.2...5.6.3) (2025-04-06)
### Bug Fixes
* fix a potential `ArgumentOutOfRangeException` that could occur when changing the FontAsset in TextMeshPro ([3b095bc](https://github.com/mob-sakai/UIEffect/commit/3b095bcebd8b1264c373b8b71c27d3c35f673f3b)), closes [#327](https://github.com/mob-sakai/UIEffect/issues/327)
## [5.6.2](https://github.com/mob-sakai/UIEffect/compare/5.6.1...5.6.2) (2025-04-04)
### Bug Fixes
* fix a potential `ArgumentOutOfRangeException` that could occur when changing the FontAsset in TextMeshPro ([909281c](https://github.com/mob-sakai/UIEffect/commit/909281c66b702d8497e9f847c91b688716b9c6a7)), closes [#327](https://github.com/mob-sakai/UIEffect/issues/327)
* Remove unnecessary vertex expansion ([974e3e8](https://github.com/mob-sakai/UIEffect/commit/974e3e8769d456c5cdd8eb1767a7cf57ab4d52fc))
* undo now works correctly after clicking the 'Clear' button in the inspector ([75ed355](https://github.com/mob-sakai/UIEffect/commit/75ed355e27faf8962390eb6788e1887ffd1b5f89))
## [5.6.1](https://github.com/mob-sakai/UIEffect/compare/5.6.0...5.6.1) (2025-03-28)
### Bug Fixes
* changes were not correctly marked as dirty when loading presets ([76be0fc](https://github.com/mob-sakai/UIEffect/commit/76be0fc860c27b89235b7fb9a766dcc38b3d9924))
# [5.6.0](https://github.com/mob-sakai/UIEffect/compare/5.5.3...5.6.0) (2025-03-28)
+1
View File
@@ -665,6 +665,7 @@ namespace Coffee.UIEffects.Editors
r.width = 55;
if (GUI.Button(r, EditorGUIUtility.TrTempContent("Clear"), "MiniButton"))
{
Undo.RecordObjects(targets, "Clear UIEffect");
Array.ForEach(targets.OfType<UIEffect>().ToArray(), Unsupported.SmartReset);
}
}
+4 -2
View File
@@ -69,6 +69,7 @@ Combine various filters, such as grayscale, blur, and dissolve, to decorate your
- **UIEffectTweener Component**: A simple tweener component to play, stop, pause, and resume effects.
- **AnimationClip support**: Allows control of effect animations using `AnimationClips`.
- **v4 compatible components (optional)**: For easy upgrading with minimal changes, compatible v4 components are available optionally.
- **SoftMaskForUGUI support (optional)**: Compatible with SoftMaskForUGUI for creating soft masks for UI elements. See for more details [here](#usage-with-softmaskforugui).
<br><br>
@@ -339,7 +340,7 @@ The `UIEffect` component applies visual effects to UI elements, allowing various
![](https://github.com/user-attachments/assets/295d7d2d-be6e-4104-9ea3-e5208902a3d2)
- **Detail Filter**: `None`, `Masking`, `Multiply`, `Additive`, `Replace`, `MuliplyAdditive`
![](https://github.com/user-attachments/assets/73933788-4179-4d8d-9b07-446d0a998227)
![](https://github.com/user-attachments/assets/7011459b-a090-4044-be1e-acfe8981ea01)
- **Detail Intensity**: 0.0 (no effect) - 1.0 (full effect).
- **Detail Threshold** (`Masking` only): The minimum and maximum alpha values used for masking. The larger the gap
between these values, the stronger the softness effect.
@@ -362,7 +363,8 @@ The `UIEffect` component applies visual effects to UI elements, allowing various
- `Horizontal`
- `Vertical`
- `Effect`: Flip with the effect.
- `Shadow`: Flip with the shadow.
- `Shadow`: Flip with the shadow.
![](https://github.com/user-attachments/assets/c3b3d475-75d3-4c8d-a329-db4f124fec45)
> [!TIP]
> `Transition Filter`, `Gradation Filter`, and `Detail Filter` usually refer to their own `RectTransform` when applying effects.
@@ -1,3 +1,4 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
@@ -110,10 +111,12 @@ namespace Coffee.UIEffectInternal
dst.Clear();
for (var i = 0; i < vertexCount; i++)
{
dst.AddVert(positions[i], colors[i], uv0[i], uv1[i], normals[i], tangents[i]);
dst.AddVert(positions.GetOrDefault(i), colors.GetOrDefault(i), uv0.GetOrDefault(i), uv1.GetOrDefault(i),
normals.GetOrDefault(i), tangents.GetOrDefault(i));
}
for (var i = 0; i < indexCount; i += 3)
var count = Mathf.Clamp(indexCount, 0, indices.Count);
for (var i = 0; i < count - 2; i += 3)
{
dst.AddTriangle(indices[i], indices[i + 1], indices[i + 2]);
}
@@ -126,5 +129,12 @@ namespace Coffee.UIEffectInternal
InternalListPool<Color32>.Return(ref colors);
InternalListPool<int>.Return(ref indices);
}
private static T GetOrDefault<T>(this List<T> self, int index)
{
return 0 <= index && index < self.Count
? self[index]
: default;
}
}
}
+2
View File
@@ -1724,6 +1724,7 @@ namespace Coffee.UIEffects
m_DetailTexSpeed = preset.m_DetailTexSpeed;
}
Misc.SetDirty(this);
UpdateContext(context);
SetVerticesDirty();
SetMaterialDirty();
@@ -1811,6 +1812,7 @@ namespace Coffee.UIEffects
m_DetailTexOffset = c.detailTexOffset;
m_DetailTexSpeed = c.detailTexSpeed;
Misc.SetDirty(this);
UpdateContext(context);
SetVerticesDirty();
SetMaterialDirty();
+10 -11
View File
@@ -749,37 +749,36 @@ namespace Coffee.UIEffects
UIVertexUtil.Flip(verts, flipHorizontal, flipVertical);
}
private Vector2 GetExpandSize(bool canModifyShape)
private Vector4 GetExpandSize(bool canModifyShape)
{
if (!canModifyShape) return Vector2.zero;
if (!canModifyShape) return Vector4.zero;
var expandSize = Vector2.zero;
var expandSize = Vector4.zero;
switch (samplingFilter)
{
case SamplingFilter.BlurFast:
expandSize.x += 10;
expandSize.y += 10;
expandSize += Vector4.one * 10;
break;
case SamplingFilter.BlurMedium:
expandSize.x += 15;
expandSize.y += 15;
expandSize += Vector4.one * 15;
break;
case SamplingFilter.BlurDetail:
expandSize.x += 20;
expandSize.y += 20;
expandSize += Vector4.one * 20;
break;
case SamplingFilter.RgbShift:
expandSize.x += 40;
expandSize.y += 40;
expandSize.z += 40;
break;
}
switch (transitionFilter)
{
case TransitionFilter.Melt:
case TransitionFilter.Burn:
expandSize.y += 40;
break;
case TransitionFilter.Burn:
expandSize.w += 40;
break;
}
return expandSize;
@@ -72,9 +72,9 @@ namespace Coffee.UIEffects
{
}
public virtual Vector4 ModifyExpandSize(Graphic graphic, Vector2 expandSize)
public virtual Vector4 ModifyExpandSize(Graphic graphic, Vector4 expandSize)
{
return new Vector4(expandSize.x, expandSize.y, expandSize.x, expandSize.y);
return expandSize;
}
private static readonly Func<UIVertex, UIVertex, UIVertex, float, UIVertex> s_OnLerpVertex =
+5 -8
View File
@@ -33,25 +33,22 @@ namespace Coffee.UIEffects
return false;
}
public override Vector4 ModifyExpandSize(Graphic graphic, Vector2 expandSize)
public override Vector4 ModifyExpandSize(Graphic graphic, Vector4 expandSize)
{
var image = graphic as Image;
var ret = new Vector4(expandSize.x, expandSize.y, expandSize.x, expandSize.y);
if (image
if (graphic is Image image
&& image.type == Image.Type.Filled
&& image.fillMethod == Image.FillMethod.Radial360
&& image.fillAmount <= 0.5f)
{
ret[(image.fillOrigin + (image.fillClockwise ? 2 : 0)) % 4] = 0;
expandSize[(image.fillOrigin + (image.fillClockwise ? 2 : 0)) % 4] = 0;
if (image.fillAmount <= 0.25f)
{
ret[(image.fillOrigin + 3) % 4] = 0;
expandSize[(image.fillOrigin + 3) % 4] = 0;
}
}
return ret;
return expandSize;
}
}
}
File diff suppressed because it is too large Load Diff
@@ -5411,7 +5411,7 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1887047859}
m_Enabled: 0
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3312d7739989d2b4e91e6319e9a96d76, type: 3}
m_Name:
+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.6.0",
"version": "5.6.3",
"unity": "2020.3",
"license": "MIT",
"repository": {