mirror of
https://github.com/mob-sakai/UIEffect.git
synced 2026-12-01 10:12:38 +08:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 95500b6c73 | |||
| ab952812d6 | |||
| aa0bf72bd4 |
@@ -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)
|
# [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 _runtimePresets;
|
||||||
private SerializedProperty _runtimePresetsV2;
|
private SerializedProperty _runtimePresetsV2;
|
||||||
private SerializedProperty _useHDRColorPicker;
|
private SerializedProperty _useHDRColorPicker;
|
||||||
|
private SerializedProperty _enableColorCorrection;
|
||||||
private ShaderVariantRegistryEditor _shaderVariantRegistryEditor;
|
private ShaderVariantRegistryEditor _shaderVariantRegistryEditor;
|
||||||
private UIEffect[] _legacyPresets;
|
private UIEffect[] _legacyPresets;
|
||||||
private bool _expandRuntimePresets;
|
private bool _expandRuntimePresets;
|
||||||
@@ -25,6 +26,7 @@ namespace Coffee.UIEffects.Editors
|
|||||||
{
|
{
|
||||||
base.OnEnable();
|
base.OnEnable();
|
||||||
_legacyPresets = UIEffectProjectSettings.LoadEditorPresets();
|
_legacyPresets = UIEffectProjectSettings.LoadEditorPresets();
|
||||||
|
_enableColorCorrection = serializedObject.FindProperty("m_EnableColorCorrection");
|
||||||
_useHDRColorPicker = serializedObject.FindProperty("m_UseHDRColorPicker");
|
_useHDRColorPicker = serializedObject.FindProperty("m_UseHDRColorPicker");
|
||||||
_runtimePresets = serializedObject.FindProperty("m_RuntimePresets");
|
_runtimePresets = serializedObject.FindProperty("m_RuntimePresets");
|
||||||
_runtimePresetsV2 = serializedObject.FindProperty("m_RuntimePresetsV2");
|
_runtimePresetsV2 = serializedObject.FindProperty("m_RuntimePresetsV2");
|
||||||
@@ -69,6 +71,17 @@ namespace Coffee.UIEffects.Editors
|
|||||||
// Legacy Presets
|
// Legacy Presets
|
||||||
DrawLegacyPresets();
|
DrawLegacyPresets();
|
||||||
|
|
||||||
|
// Settings
|
||||||
|
EditorGUI.BeginChangeCheck();
|
||||||
|
EditorGUILayout.PropertyField(_enableColorCorrection);
|
||||||
|
if (EditorGUI.EndChangeCheck())
|
||||||
|
{
|
||||||
|
foreach (var g in Misc.FindObjectsOfType<UIEffect>())
|
||||||
|
{
|
||||||
|
g.SetMaterialContextAllDirty();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Editor
|
// Editor
|
||||||
// Use HDR color pickers.
|
// Use HDR color pickers.
|
||||||
EditorGUILayout.PropertyField(_useHDRColorPicker);
|
EditorGUILayout.PropertyField(_useHDRColorPicker);
|
||||||
|
|||||||
@@ -19,7 +19,11 @@ namespace Coffee.UIEffectInternal
|
|||||||
#endif
|
#endif
|
||||||
private static void Clear()
|
private static void Clear()
|
||||||
{
|
{
|
||||||
s_Caches.Clear();
|
lock (s_Caches)
|
||||||
|
{
|
||||||
|
s_Caches.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
UIExtraCallbacks.onLateAfterCanvasRebuild -= ClearAllCache;
|
UIExtraCallbacks.onLateAfterCanvasRebuild -= ClearAllCache;
|
||||||
UIExtraCallbacks.onLateAfterCanvasRebuild += ClearAllCache;
|
UIExtraCallbacks.onLateAfterCanvasRebuild += ClearAllCache;
|
||||||
}
|
}
|
||||||
@@ -74,21 +78,27 @@ namespace Coffee.UIEffectInternal
|
|||||||
|
|
||||||
private static void ClearAllCache()
|
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>()
|
private static FrameCacheContainer<T> GetFrameCache<T>()
|
||||||
{
|
{
|
||||||
var t = typeof(T);
|
lock (s_Caches)
|
||||||
if (s_Caches.TryGetValue(t, out var frameCache)) return frameCache as FrameCacheContainer<T>;
|
{
|
||||||
|
var t = typeof(T);
|
||||||
|
if (s_Caches.TryGetValue(t, out var frameCache)) return frameCache as FrameCacheContainer<T>;
|
||||||
|
|
||||||
frameCache = new FrameCacheContainer<T>();
|
frameCache = new FrameCacheContainer<T>();
|
||||||
s_Caches.Add(t, frameCache);
|
s_Caches.Add(t, frameCache);
|
||||||
|
|
||||||
return (FrameCacheContainer<T>)frameCache;
|
return (FrameCacheContainer<T>)frameCache;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private interface IFrameCache
|
private interface IFrameCache
|
||||||
@@ -102,17 +112,26 @@ namespace Coffee.UIEffectInternal
|
|||||||
|
|
||||||
public void Clear()
|
public void Clear()
|
||||||
{
|
{
|
||||||
_caches.Clear();
|
lock (_caches)
|
||||||
|
{
|
||||||
|
_caches.Clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool TryGet((int, int) key, out T result)
|
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)
|
public void Set((int, int) key, T result)
|
||||||
{
|
{
|
||||||
_caches[key] = result;
|
lock (_caches)
|
||||||
|
{
|
||||||
|
_caches[key] = result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ using UnityEditor.SceneManagement;
|
|||||||
#else
|
#else
|
||||||
using UnityEditor.Experimental.SceneManagement;
|
using UnityEditor.Experimental.SceneManagement;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace Coffee.UIEffectInternal
|
namespace Coffee.UIEffectInternal
|
||||||
|
|||||||
@@ -288,6 +288,13 @@ namespace Coffee.UIEffects
|
|||||||
_isContextDirty = true;
|
_isContextDirty = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SetMaterialContextAllDirty()
|
||||||
|
{
|
||||||
|
_isContextDirty = true;
|
||||||
|
context.SetGradationDirty();
|
||||||
|
context.SetTransitionGradationDirty();
|
||||||
|
}
|
||||||
|
|
||||||
internal void ReleaseMaterial()
|
internal void ReleaseMaterial()
|
||||||
{
|
{
|
||||||
MaterialRepository.Release(ref _material);
|
MaterialRepository.Release(ref _material);
|
||||||
|
|||||||
@@ -852,7 +852,15 @@ namespace Coffee.UIEffects
|
|||||||
|
|
||||||
private static Color ApplyColorSpace(Color color)
|
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]
|
[SerializeField]
|
||||||
internal List<UIEffectPreset> m_RuntimePresetsV2 = new List<UIEffectPreset>();
|
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")]
|
[Header("Editor")]
|
||||||
[Tooltip("Use HDR color pickers on color fields.")]
|
[Tooltip("Use HDR color pickers on color fields.")]
|
||||||
[HideInInspector]
|
[HideInInspector]
|
||||||
@@ -38,6 +44,16 @@ namespace Coffee.UIEffects
|
|||||||
|
|
||||||
public static ShaderVariantCollection shaderVariantCollection => shaderRegistry.shaderVariantCollection;
|
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
|
public static bool useHdrColorPicker
|
||||||
{
|
{
|
||||||
get => instance.m_UseHDRColorPicker;
|
get => instance.m_UseHDRColorPicker;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"name": "com.coffee.ui-effect.shadergraph-builtin",
|
"name": "com.coffee.ui-effect.shadergraph-builtin",
|
||||||
"displayName": "UI Effect - ShaderGraph Support (Unity 6 BuiltIn)",
|
"displayName": "UI Effect - ShaderGraph Support (Unity 6 BuiltIn)",
|
||||||
"description": "An extension for UI Effect that adds 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",
|
"unity": "2020.3",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
"url": "https://github.com/mob-sakai"
|
"url": "https://github.com/mob-sakai"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"com.coffee.ui-effect": "5.12.0"
|
"com.coffee.ui-effect": "5.12.1"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"ui",
|
"ui",
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"name": "com.coffee.ui-effect.shadergraph-urp",
|
"name": "com.coffee.ui-effect.shadergraph-urp",
|
||||||
"displayName": "UI Effect - ShaderGraph Support (Unity 6 URP)",
|
"displayName": "UI Effect - ShaderGraph Support (Unity 6 URP)",
|
||||||
"description": "An extension for UI Effect that adds 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",
|
"unity": "2020.3",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -15,8 +15,8 @@
|
|||||||
"url": "https://github.com/mob-sakai"
|
"url": "https://github.com/mob-sakai"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"com.coffee.ui-effect": "5.12.0",
|
"com.coffee.ui-effect": "5.12.1",
|
||||||
"com.coffee.ui-effect-shadergraph-builtin": "5.12.0"
|
"com.coffee.ui-effect-shadergraph-builtin": "5.12.1"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"ui",
|
"ui",
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"name": "com.coffee.ui-effect.textmeshpro-legacy",
|
"name": "com.coffee.ui-effect.textmeshpro-legacy",
|
||||||
"displayName": "UI Effect - TextMeshPro Support",
|
"displayName": "UI Effect - TextMeshPro Support",
|
||||||
"description": "An extension for UI Effect that adds TextMeshPro support.",
|
"description": "An extension for UI Effect that adds TextMeshPro support.",
|
||||||
"version": "5.12.0",
|
"version": "5.12.1",
|
||||||
"unity": "2020.3",
|
"unity": "2020.3",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
"url": "https://github.com/mob-sakai"
|
"url": "https://github.com/mob-sakai"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"com.coffee.ui-effect": "5.12.0"
|
"com.coffee.ui-effect": "5.12.1"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"ui",
|
"ui",
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"name": "com.coffee.ui-effect.textmeshpro",
|
"name": "com.coffee.ui-effect.textmeshpro",
|
||||||
"displayName": "UI Effect - TextMeshPro Support (Unity 6)",
|
"displayName": "UI Effect - TextMeshPro Support (Unity 6)",
|
||||||
"description": "An extension for UI Effect that adds 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",
|
"unity": "2020.3",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
"url": "https://github.com/mob-sakai"
|
"url": "https://github.com/mob-sakai"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"com.coffee.ui-effect": "5.12.0"
|
"com.coffee.ui-effect": "5.12.1"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"ui",
|
"ui",
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"name": "com.coffee.ui-effect.v4-compatible-components",
|
"name": "com.coffee.ui-effect.v4-compatible-components",
|
||||||
"displayName": "UI Effect - v4 Compatible Components",
|
"displayName": "UI Effect - v4 Compatible Components",
|
||||||
"description": "An extension for UI Effect that adds 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",
|
"unity": "2020.3",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
"url": "https://github.com/mob-sakai"
|
"url": "https://github.com/mob-sakai"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"com.coffee.ui-effect": "5.12.0",
|
"com.coffee.ui-effect": "5.12.1",
|
||||||
"com.unity.modules.animation": "1.0.0"
|
"com.unity.modules.animation": "1.0.0"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"name": "com.coffee.ui-effect",
|
"name": "com.coffee.ui-effect",
|
||||||
"displayName": "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!",
|
"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",
|
"unity": "2020.3",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
Reference in New Issue
Block a user