Compare commits

...

3 Commits

Author SHA1 Message Date
semantic-release-bot 95500b6c73 chore(release): 5.12.1 [skip ci]
## [5.12.1](https://github.com/mob-sakai/UIEffect/compare/5.12.0...5.12.1) (2026-11-24)

### Bug Fixes

* Added an option to Project Settings to disable color correction and revert to the color output used in version 5.11.8 or earlier ([aa0bf72](https://github.com/mob-sakai/UIEffect/commit/aa0bf72bd429eb2aa173f316e5863bb9bee2eb4e)), closes [#414](https://github.com/mob-sakai/UIEffect/issues/414)
2026-11-24 06:00:36 +00:00
mob-sakai ab952812d6 chore: update internal code 2026-11-24 14:51:10 +09:00
mob-sakai aa0bf72bd4 fix: Added an option to Project Settings to disable color correction and revert to the color output used in version 5.11.8 or earlier
close #414
2026-11-24 14:50:59 +09:00
13 changed files with 95 additions and 24 deletions
+7
View File
@@ -1,3 +1,10 @@
## [5.12.1](https://github.com/mob-sakai/UIEffect/compare/5.12.0...5.12.1) (2026-11-24)
### Bug Fixes
* Added an option to Project Settings to disable color correction and revert to the color output used in version 5.11.8 or earlier ([aa0bf72](https://github.com/mob-sakai/UIEffect/commit/aa0bf72bd429eb2aa173f316e5863bb9bee2eb4e)), closes [#414](https://github.com/mob-sakai/UIEffect/issues/414)
# [5.12.0](https://github.com/mob-sakai/UIEffect/compare/5.11.10...5.12.0) (2026-11-17)
@@ -16,6 +16,7 @@ namespace Coffee.UIEffects.Editors
private SerializedProperty _runtimePresets;
private SerializedProperty _runtimePresetsV2;
private SerializedProperty _useHDRColorPicker;
private SerializedProperty _enableColorCorrection;
private ShaderVariantRegistryEditor _shaderVariantRegistryEditor;
private UIEffect[] _legacyPresets;
private bool _expandRuntimePresets;
@@ -25,6 +26,7 @@ namespace Coffee.UIEffects.Editors
{
base.OnEnable();
_legacyPresets = UIEffectProjectSettings.LoadEditorPresets();
_enableColorCorrection = serializedObject.FindProperty("m_EnableColorCorrection");
_useHDRColorPicker = serializedObject.FindProperty("m_UseHDRColorPicker");
_runtimePresets = serializedObject.FindProperty("m_RuntimePresets");
_runtimePresetsV2 = serializedObject.FindProperty("m_RuntimePresetsV2");
@@ -69,6 +71,17 @@ namespace Coffee.UIEffects.Editors
// Legacy Presets
DrawLegacyPresets();
// Settings
EditorGUI.BeginChangeCheck();
EditorGUILayout.PropertyField(_enableColorCorrection);
if (EditorGUI.EndChangeCheck())
{
foreach (var g in Misc.FindObjectsOfType<UIEffect>())
{
g.SetMaterialContextAllDirty();
}
}
// Editor
// Use HDR color pickers.
EditorGUILayout.PropertyField(_useHDRColorPicker);
@@ -19,7 +19,11 @@ namespace Coffee.UIEffectInternal
#endif
private static void Clear()
{
s_Caches.Clear();
lock (s_Caches)
{
s_Caches.Clear();
}
UIExtraCallbacks.onLateAfterCanvasRebuild -= ClearAllCache;
UIExtraCallbacks.onLateAfterCanvasRebuild += ClearAllCache;
}
@@ -74,21 +78,27 @@ namespace Coffee.UIEffectInternal
private static void ClearAllCache()
{
foreach (var cache in s_Caches.Values)
lock (s_Caches)
{
cache.Clear();
foreach (var cache in s_Caches.Values)
{
cache.Clear();
}
}
}
private static FrameCacheContainer<T> GetFrameCache<T>()
{
var t = typeof(T);
if (s_Caches.TryGetValue(t, out var frameCache)) return frameCache as FrameCacheContainer<T>;
lock (s_Caches)
{
var t = typeof(T);
if (s_Caches.TryGetValue(t, out var frameCache)) return frameCache as FrameCacheContainer<T>;
frameCache = new FrameCacheContainer<T>();
s_Caches.Add(t, frameCache);
frameCache = new FrameCacheContainer<T>();
s_Caches.Add(t, frameCache);
return (FrameCacheContainer<T>)frameCache;
return (FrameCacheContainer<T>)frameCache;
}
}
private interface IFrameCache
@@ -102,17 +112,26 @@ namespace Coffee.UIEffectInternal
public void Clear()
{
_caches.Clear();
lock (_caches)
{
_caches.Clear();
}
}
public bool TryGet((int, int) key, out T result)
{
return _caches.TryGetValue(key, out result);
lock (_caches)
{
return _caches.TryGetValue(key, out result);
}
}
public void Set((int, int) key, T result)
{
_caches[key] = result;
lock (_caches)
{
_caches[key] = result;
}
}
}
}
@@ -13,6 +13,7 @@ using UnityEditor.SceneManagement;
#else
using UnityEditor.Experimental.SceneManagement;
#endif
#endif
namespace Coffee.UIEffectInternal
+7
View File
@@ -288,6 +288,13 @@ namespace Coffee.UIEffects
_isContextDirty = true;
}
public void SetMaterialContextAllDirty()
{
_isContextDirty = true;
context.SetGradationDirty();
context.SetTransitionGradationDirty();
}
internal void ReleaseMaterial()
{
MaterialRepository.Release(ref _material);
+9 -1
View File
@@ -852,7 +852,15 @@ namespace Coffee.UIEffects
private static Color ApplyColorSpace(Color color)
{
return QualitySettings.activeColorSpace == ColorSpace.Linear ? color : color.gamma;
// v5.11.9 or later, color correction is applied to the color filter and gradation colors.
if (UIEffectProjectSettings.enableColorCorrection)
{
return QualitySettings.activeColorSpace == ColorSpace.Linear ? color : color.gamma;
}
else
{
return QualitySettings.activeColorSpace == ColorSpace.Linear ? color.linear : color;
}
}
}
}
@@ -21,6 +21,12 @@ namespace Coffee.UIEffects
[SerializeField]
internal List<UIEffectPreset> m_RuntimePresetsV2 = new List<UIEffectPreset>();
[Header("Settings")]
[Tooltip("Whether to enable the color correction feature added in v5.11.9.\n" +
"If disabled, the color picker will not display the correct colors, but compatibility with previous versions can be maintained.")]
[HideInInspector]
[SerializeField] private bool m_EnableColorCorrection = true;
[Header("Editor")]
[Tooltip("Use HDR color pickers on color fields.")]
[HideInInspector]
@@ -38,6 +44,16 @@ namespace Coffee.UIEffects
public static ShaderVariantCollection shaderVariantCollection => shaderRegistry.shaderVariantCollection;
/// <summary>
/// Whether to enable the color correction feature added in v5.11.9.
/// If disabled, the color picker will not display the correct colors, but compatibility with previous
/// versions can be maintained.
/// </summary>
public static bool enableColorCorrection => instance.m_EnableColorCorrection;
/// <summary>
/// Whether to use HDR color pickers on color fields.
/// </summary>
public static bool useHdrColorPicker
{
get => instance.m_UseHDRColorPicker;
@@ -2,7 +2,7 @@
"name": "com.coffee.ui-effect.shadergraph-builtin",
"displayName": "UI Effect - ShaderGraph Support (Unity 6 BuiltIn)",
"description": "An extension for UI Effect that adds ShaderGraph support (Unity 6 BuiltIn).",
"version": "5.12.0",
"version": "5.12.1",
"unity": "2020.3",
"license": "MIT",
"repository": {
@@ -15,7 +15,7 @@
"url": "https://github.com/mob-sakai"
},
"dependencies": {
"com.coffee.ui-effect": "5.12.0"
"com.coffee.ui-effect": "5.12.1"
},
"keywords": [
"ui",
@@ -2,7 +2,7 @@
"name": "com.coffee.ui-effect.shadergraph-urp",
"displayName": "UI Effect - ShaderGraph Support (Unity 6 URP)",
"description": "An extension for UI Effect that adds ShaderGraph support (Unity 6 URP).",
"version": "5.12.0",
"version": "5.12.1",
"unity": "2020.3",
"license": "MIT",
"repository": {
@@ -15,8 +15,8 @@
"url": "https://github.com/mob-sakai"
},
"dependencies": {
"com.coffee.ui-effect": "5.12.0",
"com.coffee.ui-effect-shadergraph-builtin": "5.12.0"
"com.coffee.ui-effect": "5.12.1",
"com.coffee.ui-effect-shadergraph-builtin": "5.12.1"
},
"keywords": [
"ui",
@@ -2,7 +2,7 @@
"name": "com.coffee.ui-effect.textmeshpro-legacy",
"displayName": "UI Effect - TextMeshPro Support",
"description": "An extension for UI Effect that adds TextMeshPro support.",
"version": "5.12.0",
"version": "5.12.1",
"unity": "2020.3",
"license": "MIT",
"repository": {
@@ -15,7 +15,7 @@
"url": "https://github.com/mob-sakai"
},
"dependencies": {
"com.coffee.ui-effect": "5.12.0"
"com.coffee.ui-effect": "5.12.1"
},
"keywords": [
"ui",
@@ -2,7 +2,7 @@
"name": "com.coffee.ui-effect.textmeshpro",
"displayName": "UI Effect - TextMeshPro Support (Unity 6)",
"description": "An extension for UI Effect that adds TextMeshPro support (Unity 6).",
"version": "5.12.0",
"version": "5.12.1",
"unity": "2020.3",
"license": "MIT",
"repository": {
@@ -15,7 +15,7 @@
"url": "https://github.com/mob-sakai"
},
"dependencies": {
"com.coffee.ui-effect": "5.12.0"
"com.coffee.ui-effect": "5.12.1"
},
"keywords": [
"ui",
@@ -2,7 +2,7 @@
"name": "com.coffee.ui-effect.v4-compatible-components",
"displayName": "UI Effect - v4 Compatible Components",
"description": "An extension for UI Effect that adds v4 compatible components.",
"version": "5.12.0",
"version": "5.12.1",
"unity": "2020.3",
"license": "MIT",
"repository": {
@@ -15,7 +15,7 @@
"url": "https://github.com/mob-sakai"
},
"dependencies": {
"com.coffee.ui-effect": "5.12.0",
"com.coffee.ui-effect": "5.12.1",
"com.unity.modules.animation": "1.0.0"
},
"keywords": [
+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.12.0",
"version": "5.12.1",
"unity": "2020.3",
"license": "MIT",
"repository": {