mirror of
https://github.com/mob-sakai/UIEffect.git
synced 2026-11-20 01:42:37 +08:00
Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 213daa85e9 | |||
| 6e4d4ab03d | |||
| 4222d72318 | |||
| 8159c091e8 | |||
| 2b44837bb9 | |||
| 1d849e54cb | |||
| 811f5762e6 | |||
| 2f63adfba0 | |||
| 7cb8325e44 | |||
| eafb9ce365 | |||
| 0ef6027371 | |||
| 92f9611a39 | |||
| edf694313f | |||
| 894c5610d0 | |||
| f7175c0373 | |||
| 238a17d57d | |||
| 97237b3aa8 | |||
| 1be0cd45db |
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e9a477d4a32184f16b50f56f7de5fa4e
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 962016ab124fa4720be1e24ff58c8522
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "Coffee.UIEffect.EditorTests",
|
||||
"references": [
|
||||
"Coffee.UIEffect"
|
||||
],
|
||||
"optionalUnityReferences": [
|
||||
"TestAssemblies"
|
||||
],
|
||||
"includePlatforms": [
|
||||
"Editor"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 182e53eada385475e905b8ca6d82d6ad
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using NUnit.Framework;
|
||||
using UnityEditor;
|
||||
|
||||
public class ReflectionTests
|
||||
{
|
||||
[Test]
|
||||
public void ShaderVariantCollectionInspector_DrawShaderEntry()
|
||||
{
|
||||
var type = Type.GetType("UnityEditor.ShaderVariantCollectionInspector, UnityEditor");
|
||||
Assert.IsNotNull(type, "'UnityEditor.ShaderVariantCollectionInspector, UnityEditor' is not found");
|
||||
|
||||
var miDrawShaderEntry = type.GetMethod("DrawShaderEntry", BindingFlags.NonPublic | BindingFlags.Instance);
|
||||
Assert.IsNotNull(miDrawShaderEntry);
|
||||
|
||||
var parameters = miDrawShaderEntry.GetParameters();
|
||||
Assert.AreEqual(1, parameters.Length);
|
||||
Assert.AreEqual(typeof(int), parameters[0].ParameterType);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SerializedProperty_gradientValue()
|
||||
{
|
||||
var piGradient = typeof(SerializedProperty)
|
||||
.GetProperty("gradientValue", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);
|
||||
Assert.IsNotNull(piGradient);
|
||||
|
||||
Assert.IsTrue(piGradient.CanRead);
|
||||
Assert.IsTrue(piGradient.CanWrite);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7c5d391ce913d41fb9118c3d28b21059
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,3 +1,37 @@
|
||||
## [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)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* `Gradation` properties do not update when a preset is loaded ([edf6943](https://github.com/mob-sakai/UIEffect/commit/edf694313f101b66f760bca64593fb87037dcb3d)), closes [#291](https://github.com/mob-sakai/UIEffect/issues/291)
|
||||
* an error occurs when saving a preset ([894c561](https://github.com/mob-sakai/UIEffect/commit/894c5610d044f211067037b6c69f9860ac496ffc)), closes [#293](https://github.com/mob-sakai/UIEffect/issues/293)
|
||||
* fix gradation gradient edge (angle gradient) ([0ef6027](https://github.com/mob-sakai/UIEffect/commit/0ef60273714c7b68131f2f0d233b16335a5cd367))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* `Angle Gradient` gradation supports fixed mode gradient ([7cb8325](https://github.com/mob-sakai/UIEffect/commit/7cb8325e445350d2175865f736186f719e1cbe00))
|
||||
* `Angle Gradient` gradation supports RectTransform pivot ([2f63adf](https://github.com/mob-sakai/UIEffect/commit/2f63adfba057bec7f8183a5b34654cdf84163a34))
|
||||
* add `Use HDR Color Picker` option for project settings (editor) ([1be0cd4](https://github.com/mob-sakai/UIEffect/commit/1be0cd45db952d05e51d508c58f65a6541df9de0)), closes [#290](https://github.com/mob-sakai/UIEffect/issues/290)
|
||||
* the `Allow To Modify Mesh Shape` property should remain unchanged when loading a preset ([f7175c0](https://github.com/mob-sakai/UIEffect/commit/f7175c037371278eb7a0c7883cffccb5c31dba0a)), closes [#294](https://github.com/mob-sakai/UIEffect/issues/294)
|
||||
* the `Sampling Scale` property should remain unchanged when loading a preset ([238a17d](https://github.com/mob-sakai/UIEffect/commit/238a17d57ddf1f6b859ce830e80a1be6c3d739f1)), closes [#292](https://github.com/mob-sakai/UIEffect/issues/292)
|
||||
|
||||
# [5.1.0](https://github.com/mob-sakai/UIEffect/compare/5.0.2...5.1.0) (2024-12-31)
|
||||
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using UnityEngine;
|
||||
using System.Linq;
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using Object = UnityEngine.Object;
|
||||
|
||||
namespace Coffee.UIEffects.Editors
|
||||
@@ -13,6 +14,17 @@ namespace Coffee.UIEffects.Editors
|
||||
[CanEditMultipleObjects]
|
||||
public class UIEffect2Editor : Editor
|
||||
{
|
||||
private static readonly PropertyInfo s_PiGradient = typeof(SerializedProperty)
|
||||
.GetProperty("gradientValue", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);
|
||||
|
||||
private static readonly Func<SerializedProperty, Gradient> s_GetGradient =
|
||||
(Func<SerializedProperty, Gradient>)Delegate.CreateDelegate(typeof(Func<SerializedProperty, Gradient>),
|
||||
s_PiGradient.GetMethod);
|
||||
|
||||
private static readonly Action<SerializedProperty, Gradient> s_SetGradient =
|
||||
(Action<SerializedProperty, Gradient>)Delegate.CreateDelegate(typeof(Action<SerializedProperty, Gradient>),
|
||||
s_PiGradient.SetMethod);
|
||||
|
||||
private SerializedProperty _toneFilter;
|
||||
private SerializedProperty _toneIntensity;
|
||||
|
||||
@@ -68,7 +80,7 @@ namespace Coffee.UIEffects.Editors
|
||||
private SerializedProperty _gradationScale;
|
||||
private SerializedProperty _gradationRotation;
|
||||
|
||||
private bool _expandOthers;
|
||||
private bool _expandOthers = true;
|
||||
private SerializedProperty _allowToModifyMeshShape;
|
||||
|
||||
private void OnEnable()
|
||||
@@ -77,7 +89,6 @@ namespace Coffee.UIEffects.Editors
|
||||
|
||||
_toneFilter = serializedObject.FindProperty("m_ToneFilter");
|
||||
_toneIntensity = serializedObject.FindProperty("m_ToneIntensity");
|
||||
var toneParams = serializedObject.FindProperty("m_ToneParams");
|
||||
|
||||
_colorFilter = serializedObject.FindProperty("m_ColorFilter");
|
||||
_color = serializedObject.FindProperty("m_Color");
|
||||
@@ -162,7 +173,7 @@ namespace Coffee.UIEffects.Editors
|
||||
{
|
||||
EditorGUI.indentLevel++;
|
||||
EditorGUILayout.PropertyField(_colorIntensity);
|
||||
DrawColor(_colorFilter, _color, prevColorFilter);
|
||||
DrawColor(_colorFilter, _color, prevColorFilter, false);
|
||||
EditorGUILayout.PropertyField(_colorGlow);
|
||||
EditorGUI.indentLevel--;
|
||||
}
|
||||
@@ -175,7 +186,6 @@ namespace Coffee.UIEffects.Editors
|
||||
{
|
||||
EditorGUI.indentLevel++;
|
||||
EditorGUILayout.PropertyField(_samplingIntensity);
|
||||
EditorGUILayout.PropertyField(_samplingScale);
|
||||
EditorGUI.indentLevel--;
|
||||
}
|
||||
|
||||
@@ -260,7 +270,7 @@ namespace Coffee.UIEffects.Editors
|
||||
}
|
||||
|
||||
EditorGUILayout.PropertyField(_shadowColorFilter);
|
||||
EditorGUILayout.PropertyField(_shadowColor);
|
||||
DrawColorPickerField(_shadowColor, false);
|
||||
EditorGUILayout.PropertyField(_shadowColorGlow);
|
||||
EditorGUILayout.PropertyField(_shadowFade);
|
||||
|
||||
@@ -286,15 +296,16 @@ namespace Coffee.UIEffects.Editors
|
||||
case GradationMode.HorizontalGradient:
|
||||
case GradationMode.VerticalGradient:
|
||||
case GradationMode.AngleGradient:
|
||||
EditorGUILayout.PropertyField(_gradationGradient);
|
||||
DrawGradientField(_gradationGradient);
|
||||
break;
|
||||
default:
|
||||
EditorGUILayout.PropertyField(_gradationColor1);
|
||||
DrawColorPickerField(_gradationColor1);
|
||||
var r = EditorGUILayout.GetControlRect();
|
||||
r.width -= 20;
|
||||
EditorGUI.PropertyField(r, _gradationColor2);
|
||||
r.width -= 24;
|
||||
r.height = EditorGUIUtility.singleLineHeight;
|
||||
DrawColorPickerField(r, _gradationColor2);
|
||||
|
||||
r.x += r.width;
|
||||
r.x += r.width + 4;
|
||||
r.width = 20;
|
||||
// Swap colors
|
||||
if (GUI.Button(r, EditorGUIUtility.IconContent("preaudioloopoff"), "iconbutton"))
|
||||
@@ -322,11 +333,53 @@ namespace Coffee.UIEffects.Editors
|
||||
_expandOthers = EditorGUILayout.BeginFoldoutHeaderGroup(_expandOthers, "Others");
|
||||
if (_expandOthers)
|
||||
{
|
||||
EditorGUILayout.PropertyField(_samplingScale);
|
||||
EditorGUILayout.PropertyField(_allowToModifyMeshShape);
|
||||
}
|
||||
}
|
||||
|
||||
private static void DrawColor(SerializedProperty filter, SerializedProperty color, ColorFilter prevFilter)
|
||||
private static void DrawColorPickerField(SerializedProperty color, bool showAlpha = true)
|
||||
{
|
||||
var r = EditorGUILayout.GetControlRect();
|
||||
r.height = EditorGUIUtility.singleLineHeight;
|
||||
DrawColorPickerField(r, color, showAlpha);
|
||||
}
|
||||
|
||||
private static void DrawColorPickerField(Rect rect, SerializedProperty color, bool showAlpha = true)
|
||||
{
|
||||
var label = EditorGUIUtility.TrTempContent(color.displayName);
|
||||
label.tooltip = color.tooltip;
|
||||
var hdr = UIEffectProjectSettings.useHdrColorPicker;
|
||||
EditorGUI.showMixedValue = color.hasMultipleDifferentValues;
|
||||
|
||||
EditorGUI.BeginChangeCheck();
|
||||
var colorValue = EditorGUI.ColorField(rect, label, color.colorValue, true, showAlpha, hdr);
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
color.colorValue = colorValue;
|
||||
}
|
||||
}
|
||||
|
||||
private static void DrawGradientField(SerializedProperty gradient)
|
||||
{
|
||||
var r = EditorGUILayout.GetControlRect();
|
||||
r.height = EditorGUIUtility.singleLineHeight;
|
||||
|
||||
var label = EditorGUIUtility.TrTempContent(gradient.displayName);
|
||||
label.tooltip = gradient.tooltip;
|
||||
var hdr = UIEffectProjectSettings.useHdrColorPicker;
|
||||
EditorGUI.showMixedValue = gradient.hasMultipleDifferentValues;
|
||||
|
||||
EditorGUI.BeginChangeCheck();
|
||||
var gradientValue = EditorGUI.GradientField(r, label, s_GetGradient(gradient), hdr);
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
s_SetGradient(gradient, gradientValue);
|
||||
}
|
||||
}
|
||||
|
||||
private static void DrawColor(SerializedProperty filter, SerializedProperty color, ColorFilter prevFilter,
|
||||
bool showAlpha = true)
|
||||
{
|
||||
if (filter.intValue == (int)ColorFilter.None)
|
||||
{
|
||||
@@ -361,7 +414,7 @@ namespace Coffee.UIEffects.Editors
|
||||
color.colorValue = Color.white;
|
||||
}
|
||||
|
||||
EditorGUILayout.PropertyField(color);
|
||||
DrawColorPickerField(color, showAlpha);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -404,7 +457,10 @@ namespace Coffee.UIEffects.Editors
|
||||
r.x += r.width;
|
||||
if (GUI.Button(r, EditorGUIUtility.TrTempContent("Save As New"), "MiniButton"))
|
||||
{
|
||||
UIEffectProjectSettings.SaveAsNewPreset(targets.OfType<UIEffect>().FirstOrDefault());
|
||||
EditorApplication.delayCall += () =>
|
||||
{
|
||||
UIEffectProjectSettings.SaveAsNewPreset(targets.OfType<UIEffect>().FirstOrDefault());
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ namespace Coffee.UIEffects.Editors
|
||||
public class UIEffectProjectSettingsEditor : Editor
|
||||
{
|
||||
private ReorderableList _reorderableList;
|
||||
private SerializedProperty _useHDRColorPicker;
|
||||
private SerializedProperty _transformSensitivity;
|
||||
private bool _isInitialized;
|
||||
private ShaderVariantRegistryEditor _shaderVariantRegistryEditor;
|
||||
@@ -18,6 +19,7 @@ namespace Coffee.UIEffects.Editors
|
||||
if (_isInitialized) return;
|
||||
|
||||
_transformSensitivity = serializedObject.FindProperty("m_TransformSensitivity");
|
||||
_useHDRColorPicker = serializedObject.FindProperty("m_UseHDRColorPicker");
|
||||
var runtimePresets = serializedObject.FindProperty("m_RuntimePresets");
|
||||
_reorderableList = new ReorderableList(serializedObject, runtimePresets, true, true, true, true);
|
||||
_reorderableList.drawHeaderCallback = rect => EditorGUI.LabelField(rect, "Runtime Presets");
|
||||
@@ -63,9 +65,17 @@ namespace Coffee.UIEffects.Editors
|
||||
InitializeIfNeeded();
|
||||
|
||||
// Settings
|
||||
// Transform sensitivity.
|
||||
EditorGUILayout.PropertyField(_transformSensitivity);
|
||||
|
||||
// Runtime Presets
|
||||
_reorderableList.DoLayoutList();
|
||||
|
||||
// Editor
|
||||
// Use HDR color pickers.
|
||||
EditorGUILayout.PropertyField(_useHDRColorPicker);
|
||||
|
||||
// Shader
|
||||
// Shader registry
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.LabelField("Shader", EditorStyles.boldLabel);
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace Coffee.UIEffects.Editors
|
||||
private SerializedProperty _target;
|
||||
private SerializedProperty _useTargetTransform;
|
||||
private SerializedProperty _samplingScale;
|
||||
private SerializedProperty _allowToModifyMeshShape;
|
||||
private Editor _uiEffectEditor;
|
||||
|
||||
private void OnEnable()
|
||||
@@ -19,6 +20,7 @@ namespace Coffee.UIEffects.Editors
|
||||
_target = serializedObject.FindProperty("m_Target");
|
||||
_useTargetTransform = serializedObject.FindProperty("m_UseTargetTransform");
|
||||
_samplingScale = serializedObject.FindProperty("m_SamplingScale");
|
||||
_allowToModifyMeshShape = serializedObject.FindProperty("m_AllowToModifyMeshShape");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
@@ -27,6 +29,7 @@ namespace Coffee.UIEffects.Editors
|
||||
EditorGUILayout.PropertyField(_target);
|
||||
EditorGUILayout.PropertyField(_useTargetTransform);
|
||||
EditorGUILayout.PropertyField(_samplingScale);
|
||||
EditorGUILayout.PropertyField(_allowToModifyMeshShape);
|
||||
|
||||
if (_target.objectReferenceValue)
|
||||
{
|
||||
|
||||
+28
-7
@@ -183,7 +183,7 @@ If upgrading from UIEffect v4 to v5, note the following breaking changes:
|
||||
|
||||
### Component: UIEffect
|
||||
|
||||

|
||||

|
||||
|
||||
The `UIEffect` component applies visual effects to UI elements, allowing various effects to be achieved by combining multiple filters.
|
||||
|
||||
@@ -202,8 +202,6 @@ The `UIEffect` component applies visual effects to UI elements, allowing various
|
||||
|
||||
- **Sampling Filter**: `None`, `Blur Fast`, `Blur Medium`, `Blur Detail`, `Pixelation`, `Rgb Shift`, `Edge Luminescence`, `Edge Alpha`
|
||||
- **Sampling Intensity**: 0.0 (no effect) - 1.0 (full effect).
|
||||
- **Sampling Scale**: The referencing scale during sampling.
|
||||
- Larger values are suitable for high-resolution textures.
|
||||
|
||||
#### Transition Filter
|
||||
|
||||
@@ -255,10 +253,13 @@ The `UIEffect` component applies visual effects to UI elements, allowing various
|
||||
> `Horizontal Gradient` and `Vertical Gradient` divide the mesh horizontally or vertically and apply a gradient.
|
||||
> This is very fast but only supports Full Rect.
|
||||
> `Angle Gradient` divides the mesh at the specified angle and applies a gradient.
|
||||
> It can be applied to meshes other than Full Rect because it applies the gradient according to the original mesh shape.
|
||||
> It can be applied to meshes other than Full Rect because it applies the gradient according to the original mesh shape.
|
||||
> `Gradation Gradient` has two modes, `Blend` and `Fixed`.
|
||||
|
||||
#### Others
|
||||
|
||||
- **Sampling Scale**: The referencing scale during sampling.
|
||||
- Larger values are suitable for high-resolution textures.
|
||||
- **Allow To Modify Mesh Shape**: If enabled, the mesh shape can be modified.
|
||||
|
||||
<br><br>
|
||||
@@ -288,13 +289,14 @@ You can preview the animation using the seek bar and play button.
|
||||
|
||||
### Component: UIEffectReplica
|
||||
|
||||

|
||||

|
||||
|
||||
The `UIEffectReplica` component applies visual effects to UI elements by replicating the settings of another `UIEffect` component. This allows the same effect to be applied across multiple UI elements simultaneously.
|
||||
|
||||
- **Target**: The target `UIEffect` component to replicate.
|
||||
- **Use Target Transform**: Use the target's transform for some effects.
|
||||
- **Sampling Scale**: Override the sampling scale.
|
||||
- **Sampling Scale**: Override the sampling scale.
|
||||
- **Allow To Modify Mesh Shape**: If enabled, the mesh shape can be modified.
|
||||

|
||||
|
||||
<br><br>
|
||||
@@ -321,6 +323,10 @@ Alternatively, you can manually import the resources by following these steps:
|
||||
4. Add the `UIEffect` component to a TextMeshProUGUI element and adjust the effect settings. The `<font>` and `<sprite>` tags are also supported.
|
||||

|
||||
|
||||
> [!TIP]
|
||||
> `TextMeshPro Support` may change with updates to the UIEffect package.
|
||||
> If issues occur, try importing it again.
|
||||
|
||||
<br><br>
|
||||
|
||||
### Runtime/Editor Preset for UIEffect
|
||||
@@ -333,6 +339,10 @@ You can create and use presets for `UIEffect` components.
|
||||
- In the [Project Settings](#project-settings), you can register saved editor presets as runtime presets.
|
||||
- Runtime presets can be loaded using the `UIEffect.LoadPreset(presetName)` method.
|
||||
|
||||
> [!TIP]
|
||||
> Editor presets are saved in the `UIEffectPresets` directory.
|
||||
> You can also create subdirectories to customize the preset menu.
|
||||
|
||||
<br><br>
|
||||
|
||||
### Usage with Code
|
||||
@@ -362,13 +372,22 @@ UIEffectProjectSettings.shaderVariantCollection.WarmUp();
|
||||
|
||||
### Project Settings
|
||||
|
||||

|
||||

|
||||
|
||||
You can adjust the project-wide settings for UIEffect. (`Edit > Project Settings > UI > UIEffect`)
|
||||
|
||||
#### Settings
|
||||
|
||||
- **Transform Sensitivity**: `Low`, `Medium`, `High`
|
||||
- Set the sensitivity of the transformation when `Use Target Transform` is enabled in `UIEffectReplica` component.
|
||||
- **Runtime Presets**: A list of presets that can be loaded at runtime. Load them using `UIEffect.LoadPreset(presetName)` method.
|
||||
|
||||
#### Editor
|
||||
|
||||
- **Use HDR Color Picker**: If enabled, the HDR color picker will be used in the inspector.
|
||||
|
||||
#### Shader
|
||||
|
||||
- **Optional Shaders (UIEffect)**: A list of shaders that will be prioritized when a ui-effect shader is
|
||||
requested.
|
||||
- If the shader is included in the list, that shader will be used.
|
||||
@@ -392,6 +411,8 @@ Here are the limitations of UIEffect:
|
||||
- Shader variants used at runtime must be registered in the [Project Settings](#project-settings).
|
||||
- When using UIEffect with TextMeshProUGUI, `SamplingFilter.BlurMedium` and `SamplingFilter.BlurDetail` are not supported due to performance considerations.
|
||||
- These will automatically fall back to `SamplingFilter.BlurFast`.
|
||||
- UIEffect supports default UI components (`Image`, `RawImage`, `Text`) and `TextMeshProUGUI`.
|
||||
- If you want to use UIEffect with other components, create a issue or pull request.
|
||||
|
||||
<br><br>
|
||||
|
||||
|
||||
@@ -26,7 +26,6 @@ namespace Coffee.UIEffects
|
||||
[SerializeField]
|
||||
protected float m_ColorIntensity = 1;
|
||||
|
||||
[ColorUsage(false, true)]
|
||||
[SerializeField]
|
||||
protected Color m_Color = Color.white;
|
||||
|
||||
@@ -81,7 +80,6 @@ namespace Coffee.UIEffects
|
||||
[SerializeField]
|
||||
protected ColorFilter m_TransitionColorFilter = ColorFilter.MultiplyAdditive;
|
||||
|
||||
[ColorUsage(true, true)]
|
||||
[SerializeField]
|
||||
protected Color m_TransitionColor = new Color(0f, 0.5f, 1.0f, 1.0f);
|
||||
|
||||
@@ -91,7 +89,6 @@ namespace Coffee.UIEffects
|
||||
[SerializeField]
|
||||
protected TargetMode m_TargetMode = TargetMode.None;
|
||||
|
||||
[ColorUsage(false, false)]
|
||||
[SerializeField]
|
||||
protected Color m_TargetColor = Color.white;
|
||||
|
||||
@@ -137,7 +134,6 @@ namespace Coffee.UIEffects
|
||||
[SerializeField]
|
||||
protected ColorFilter m_ShadowColorFilter = ColorFilter.Replace;
|
||||
|
||||
[ColorUsage(false, true)]
|
||||
[SerializeField]
|
||||
protected Color m_ShadowColor = Color.white;
|
||||
|
||||
@@ -148,11 +144,9 @@ namespace Coffee.UIEffects
|
||||
protected GradationMode m_GradationMode = GradationMode.None;
|
||||
|
||||
[SerializeField]
|
||||
[ColorUsage(true, true)]
|
||||
protected Color m_GradationColor1 = Color.white;
|
||||
|
||||
[SerializeField]
|
||||
[ColorUsage(true, true)]
|
||||
protected Color m_GradationColor2 = Color.white;
|
||||
|
||||
[SerializeField]
|
||||
@@ -300,6 +294,8 @@ namespace Coffee.UIEffects
|
||||
? Mathf.Clamp(m_SamplingScale, 0.01f, 100)
|
||||
: 1;
|
||||
|
||||
public override bool canModifyShape => m_AllowToModifyMeshShape;
|
||||
|
||||
/// <summary>
|
||||
/// Transition filter for rendering.
|
||||
/// </summary>
|
||||
@@ -720,7 +716,7 @@ namespace Coffee.UIEffects
|
||||
set
|
||||
{
|
||||
if (m_AllowToModifyMeshShape == value) return;
|
||||
context.allowToModifyMeshShape = m_AllowToModifyMeshShape = value;
|
||||
m_AllowToModifyMeshShape = value;
|
||||
SetVerticesDirty();
|
||||
}
|
||||
}
|
||||
@@ -838,8 +834,6 @@ namespace Coffee.UIEffects
|
||||
c.gradationOffset = m_GradationOffset;
|
||||
c.gradationScale = m_GradationScale;
|
||||
c.gradationRotation = m_GradationRotation;
|
||||
|
||||
c.allowToModifyMeshShape = m_AllowToModifyMeshShape;
|
||||
}
|
||||
|
||||
public override void ApplyContextToMaterial()
|
||||
@@ -925,7 +919,6 @@ namespace Coffee.UIEffects
|
||||
|
||||
m_SamplingFilter = preset.m_SamplingFilter;
|
||||
m_SamplingIntensity = preset.m_SamplingIntensity;
|
||||
m_SamplingScale = preset.m_SamplingScale;
|
||||
|
||||
m_TransitionFilter = preset.m_TransitionFilter;
|
||||
m_TransitionRate = preset.m_TransitionRate;
|
||||
@@ -959,6 +952,15 @@ namespace Coffee.UIEffects
|
||||
m_ShadowColor = preset.m_ShadowColor;
|
||||
m_ShadowColorGlow = preset.m_ShadowColorGlow;
|
||||
|
||||
m_GradationMode = preset.m_GradationMode;
|
||||
m_GradationColor1 = preset.m_GradationColor1;
|
||||
m_GradationColor2 = preset.m_GradationColor2;
|
||||
m_GradationGradient = new Gradient();
|
||||
m_GradationGradient.SetKeys(preset.m_GradationGradient.colorKeys, preset.m_GradationGradient.alphaKeys);
|
||||
m_GradationOffset = preset.m_GradationOffset;
|
||||
m_GradationScale = preset.m_GradationScale;
|
||||
m_GradationRotation = preset.m_GradationRotation;
|
||||
|
||||
UpdateContext(context);
|
||||
ApplyContextToMaterial();
|
||||
SetVerticesDirty();
|
||||
@@ -1015,13 +1017,12 @@ namespace Coffee.UIEffects
|
||||
m_GradationMode = c.gradationMode;
|
||||
m_GradationColor1 = c.gradationColor1;
|
||||
m_GradationColor2 = c.gradationColor2;
|
||||
m_GradationGradient = c.gradationGradient;
|
||||
m_GradationGradient = new Gradient();
|
||||
m_GradationGradient.SetKeys(c.gradationGradient.colorKeys, c.gradationGradient.alphaKeys);
|
||||
m_GradationOffset = c.gradationOffset;
|
||||
m_GradationScale = c.gradationScale;
|
||||
m_GradationRotation = c.gradationRotation;
|
||||
|
||||
m_AllowToModifyMeshShape = c.allowToModifyMeshShape;
|
||||
|
||||
UpdateContext(context);
|
||||
ApplyContextToMaterial();
|
||||
SetVerticesDirty();
|
||||
|
||||
@@ -32,6 +32,7 @@ namespace Coffee.UIEffects
|
||||
public Graphic graphic => _graphic ? _graphic : _graphic = GetComponent<Graphic>();
|
||||
public virtual uint effectId => (uint)GetInstanceID();
|
||||
public virtual float actualSamplingScale => 1;
|
||||
public virtual bool canModifyShape => true;
|
||||
|
||||
public virtual UIEffectContext context
|
||||
{
|
||||
@@ -55,7 +56,7 @@ namespace Coffee.UIEffects
|
||||
if (graphic is TextMeshProUGUI)
|
||||
{
|
||||
_prevLossyScaleY = transform.lossyScale.y;
|
||||
UIExtraCallbacks.onAfterCanvasRebuild += CheckSDFScaleForTMP;
|
||||
Canvas.willRenderCanvases += CheckSDFScaleForTMP;
|
||||
UIExtraCallbacks.onScreenSizeChanged += SetVerticesDirtyForTMP;
|
||||
}
|
||||
#endif
|
||||
@@ -68,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);
|
||||
@@ -90,7 +91,7 @@ namespace Coffee.UIEffects
|
||||
{
|
||||
if (!isActiveAndEnabled || context == null) return;
|
||||
|
||||
context.ModifyMesh(graphic, transitionRoot, vh);
|
||||
context.ModifyMesh(graphic, transitionRoot, vh, canModifyShape);
|
||||
}
|
||||
|
||||
public virtual Material GetModifiedMaterial(Material baseMaterial)
|
||||
@@ -163,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)
|
||||
@@ -180,11 +176,6 @@ namespace Coffee.UIEffects
|
||||
if (graphic)
|
||||
{
|
||||
graphic.SetVerticesDirty();
|
||||
var canvas = graphic.canvas;
|
||||
if (canvas && graphic.isActiveAndEnabled)
|
||||
{
|
||||
canvas.additionalShaderChannels |= AdditionalCanvasShaderChannels.TexCoord1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -184,9 +184,6 @@ namespace Coffee.UIEffects
|
||||
public float gradationRotation;
|
||||
private List<float> _keyTimes;
|
||||
|
||||
public bool allowToModifyMeshShape;
|
||||
|
||||
|
||||
public bool willModifyMaterial => samplingFilter != SamplingFilter.None
|
||||
|| transitionFilter != TransitionFilter.None
|
||||
|| toneFilter != ToneFilter.None
|
||||
@@ -254,8 +251,6 @@ namespace Coffee.UIEffects
|
||||
gradationOffset = preset.gradationOffset;
|
||||
gradationScale = preset.gradationScale;
|
||||
gradationRotation = preset.gradationRotation;
|
||||
|
||||
allowToModifyMeshShape = preset.allowToModifyMeshShape;
|
||||
}
|
||||
|
||||
public void SetGradationDirty()
|
||||
@@ -363,14 +358,14 @@ namespace Coffee.UIEffects
|
||||
}
|
||||
}
|
||||
|
||||
public void ModifyMesh(Graphic graphic, RectTransform transitionRoot, VertexHelper vh)
|
||||
public void ModifyMesh(Graphic graphic, RectTransform transitionRoot, VertexHelper vh, bool canModifyShape)
|
||||
{
|
||||
var processor = ContextProcessor.FindProcessor(graphic);
|
||||
var isText = processor.IsText(graphic);
|
||||
processor.OnPreModifyMesh(graphic);
|
||||
|
||||
var verts = s_WorkingVertices;
|
||||
var expandSize = GetExpandSize();
|
||||
var expandSize = GetExpandSize(canModifyShape);
|
||||
var count = vh.currentIndexCount;
|
||||
|
||||
// Get the rectangle to calculate the normalized position.
|
||||
@@ -427,7 +422,7 @@ namespace Coffee.UIEffects
|
||||
}
|
||||
|
||||
// Apply gradation.
|
||||
ApplyGradation(verts, transitionRoot.rect, rectMatrix);
|
||||
ApplyGradation(verts, transitionRoot.rect, rectMatrix, canModifyShape);
|
||||
|
||||
// Apply shadow.
|
||||
ApplyShadow(transitionRoot, verts);
|
||||
@@ -436,8 +431,10 @@ namespace Coffee.UIEffects
|
||||
vh.AddUIVertexTriangleStream(verts);
|
||||
}
|
||||
|
||||
private void ApplyGradation(List<UIVertex> verts, Rect rect, Matrix4x4 m)
|
||||
private void ApplyGradation(List<UIVertex> verts, Rect rect, Matrix4x4 m, bool canModifyShape)
|
||||
{
|
||||
if (gradationMode == GradationMode.None) return;
|
||||
|
||||
var a = gradationColor1;
|
||||
var b = gradationColor2;
|
||||
var offset = gradationOffset;
|
||||
@@ -465,6 +462,7 @@ namespace Coffee.UIEffects
|
||||
GradientUtil.DoRadialGradient(verts, a, b, offset, scale, rect, m, 12);
|
||||
break;
|
||||
case GradationMode.Angle:
|
||||
rect = GradientUtil.RotateRectAsNormalized(rect, rot);
|
||||
m = Matrix4x4.Rotate(Quaternion.Euler(0, 0, rot)) * m;
|
||||
GradientUtil.DoHorizontalGradient(verts, a, b, offset, scale, rect, m);
|
||||
break;
|
||||
@@ -476,7 +474,7 @@ namespace Coffee.UIEffects
|
||||
GradientUtil.GetKeyTimes(grad, _keyTimes);
|
||||
}
|
||||
|
||||
if (allowToModifyMeshShape)
|
||||
if (canModifyShape)
|
||||
{
|
||||
var splitTimes = InternalListPool<float>.Rent();
|
||||
GradientUtil.SplitKeyTimes(_keyTimes, splitTimes, offset, scale);
|
||||
@@ -498,7 +496,7 @@ namespace Coffee.UIEffects
|
||||
GradientUtil.GetKeyTimes(grad, _keyTimes);
|
||||
}
|
||||
|
||||
if (allowToModifyMeshShape)
|
||||
if (canModifyShape)
|
||||
{
|
||||
var splitTimes = InternalListPool<float>.Rent();
|
||||
GradientUtil.SplitKeyTimes(_keyTimes, splitTimes, offset, scale);
|
||||
@@ -520,8 +518,9 @@ namespace Coffee.UIEffects
|
||||
GradientUtil.GetKeyTimes(grad, _keyTimes);
|
||||
}
|
||||
|
||||
rect = GradientUtil.RotateRectAsNormalized(rect, rot);
|
||||
m = Matrix4x4.Rotate(Quaternion.Euler(0, 0, rot)) * m;
|
||||
if (allowToModifyMeshShape)
|
||||
if (canModifyShape)
|
||||
{
|
||||
var splitTimes = InternalListPool<float>.Rent();
|
||||
GradientUtil.SplitKeyTimes(_keyTimes, splitTimes, offset, scale);
|
||||
@@ -555,9 +554,9 @@ namespace Coffee.UIEffects
|
||||
}
|
||||
}
|
||||
|
||||
private Vector2 GetExpandSize()
|
||||
private Vector2 GetExpandSize(bool canModifyShape)
|
||||
{
|
||||
if (!allowToModifyMeshShape) return Vector2.zero;
|
||||
if (!canModifyShape) return Vector2.zero;
|
||||
|
||||
var expandSize = Vector2.zero;
|
||||
switch (samplingFilter)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
@@ -20,6 +19,10 @@ namespace Coffee.UIEffects
|
||||
[SerializeField]
|
||||
internal List<UIEffect> m_RuntimePresets = new List<UIEffect>();
|
||||
|
||||
[Header("Editor")]
|
||||
[Tooltip("Use HDR color pickers on color fields.")]
|
||||
[SerializeField] private bool m_UseHDRColorPicker = true;
|
||||
|
||||
[HideInInspector]
|
||||
[SerializeField]
|
||||
internal ShaderVariantCollection m_ShaderVariantCollection;
|
||||
@@ -38,6 +41,12 @@ namespace Coffee.UIEffects
|
||||
set => instance.m_TransformSensitivity = value;
|
||||
}
|
||||
|
||||
public static bool useHdrColorPicker
|
||||
{
|
||||
get => instance.m_UseHDRColorPicker;
|
||||
set => instance.m_UseHDRColorPicker = value;
|
||||
}
|
||||
|
||||
public static void RegisterRuntimePreset(UIEffect effect)
|
||||
{
|
||||
// Already registered.
|
||||
|
||||
@@ -12,6 +12,9 @@ namespace Coffee.UIEffects
|
||||
[SerializeField]
|
||||
protected float m_SamplingScale = 1f;
|
||||
|
||||
[SerializeField]
|
||||
protected bool m_AllowToModifyMeshShape = true;
|
||||
|
||||
private UIEffect _currentTarget;
|
||||
private Matrix4x4 _prevTransformHash;
|
||||
|
||||
@@ -55,6 +58,8 @@ namespace Coffee.UIEffects
|
||||
? Mathf.Clamp(m_SamplingScale, 0.01f, 100)
|
||||
: 1;
|
||||
|
||||
public override bool canModifyShape => m_AllowToModifyMeshShape;
|
||||
|
||||
public override uint effectId => target ? target.effectId : 0;
|
||||
public override UIEffectContext context => target && target.isActiveAndEnabled ? target.context : null;
|
||||
|
||||
|
||||
@@ -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 =
|
||||
|
||||
@@ -47,6 +47,34 @@ namespace Coffee.UIEffects
|
||||
}
|
||||
}
|
||||
|
||||
public static void DoHorizontalGradientFixed(List<UIVertex> verts, Gradient gradient, float offset, float scale,
|
||||
Rect rect, Matrix4x4 m)
|
||||
{
|
||||
var count = verts.Count;
|
||||
for (var i = 0; i < count; i += 3)
|
||||
{
|
||||
var vt0 = verts[i + 0];
|
||||
var vt1 = verts[i + 1];
|
||||
var vt2 = verts[i + 2];
|
||||
var center = m.MultiplyPoint3x4((vt0.position + vt1.position + vt2.position) / 3).x;
|
||||
vt0.color *= Evaluate(gradient, rect, center, offset, scale);
|
||||
vt1.color *= Evaluate(gradient, rect, center, offset, scale);
|
||||
vt2.color *= Evaluate(gradient, rect, center, offset, scale);
|
||||
verts[i + 0] = vt0;
|
||||
verts[i + 1] = vt1;
|
||||
verts[i + 2] = vt2;
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
static Color Evaluate(Gradient gradient, Rect rect, float t, float offset, float scale)
|
||||
{
|
||||
t = Mathf.InverseLerp(rect.xMin, rect.xMax, t); // 0-1
|
||||
t = Mathf.Repeat((t - offset * scale - (1 - scale) / 2) / scale, 1); // Revert
|
||||
return gradient.Evaluate(t);
|
||||
}
|
||||
}
|
||||
|
||||
public static void DoHorizontalGradient(List<UIVertex> verts, Gradient gradient, float offset, float scale,
|
||||
Rect rect, Matrix4x4 m)
|
||||
{
|
||||
@@ -219,7 +247,14 @@ namespace Coffee.UIEffects
|
||||
float offset, float scale, Rect rect, Matrix4x4 m)
|
||||
{
|
||||
UIVertexUtil.SplitAngle(verts, splitTimes, rect, m);
|
||||
DoHorizontalGradient(verts, gradient, offset, scale, rect, m);
|
||||
if (gradient.mode == GradientMode.Fixed)
|
||||
{
|
||||
DoHorizontalGradientFixed(verts, gradient, offset, scale, rect, m);
|
||||
}
|
||||
else
|
||||
{
|
||||
DoHorizontalGradient(verts, gradient, offset, scale, rect, m);
|
||||
}
|
||||
}
|
||||
|
||||
public static void GetKeyTimes(Gradient gradient, List<float> results)
|
||||
@@ -283,9 +318,9 @@ namespace Coffee.UIEffects
|
||||
time -= scale;
|
||||
}
|
||||
|
||||
while (time < 1f)
|
||||
while (time <= 1f)
|
||||
{
|
||||
if (0 < time && !Contains(results, time))
|
||||
if (0 <= time && !Contains(results, time))
|
||||
{
|
||||
results.Add(time);
|
||||
}
|
||||
@@ -304,5 +339,41 @@ namespace Coffee.UIEffects
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static Rect RotateRectAsNormalized(Rect rect, float rot)
|
||||
{
|
||||
var rad = -rot * Mathf.Deg2Rad;
|
||||
var cos = Mathf.Cos(rad);
|
||||
var sin = Mathf.Sin(rad);
|
||||
var dir = new Vector2(cos, sin);
|
||||
var center = rect.center;
|
||||
|
||||
if (Mathf.Abs(dir.x) < 0.0001f)
|
||||
{
|
||||
rect.width = rect.height;
|
||||
}
|
||||
else if (Mathf.Abs(dir.y) < 0.0001f)
|
||||
{
|
||||
rect.height = rect.width;
|
||||
}
|
||||
else
|
||||
{
|
||||
var d0 = GetPointToLineDistance(new Vector2(rect.xMin, rect.yMax), center, dir, out var p0);
|
||||
var d1 = GetPointToLineDistance(new Vector2(rect.xMin, rect.yMin), center, dir, out var p1);
|
||||
var closest = d0 < d1 ? p0 : p1;
|
||||
rect.width = rect.height = Vector2.Distance(center, closest) * 2;
|
||||
}
|
||||
|
||||
rect.center = new Vector2(Vector2.Dot(center, dir), 0);
|
||||
return rect;
|
||||
}
|
||||
|
||||
private static float GetPointToLineDistance(Vector2 point, Vector2 origin, Vector2 dir, out Vector2 closest)
|
||||
{
|
||||
var dirNormalized = dir.normalized;
|
||||
var time = Vector2.Dot(point - origin, dirNormalized);
|
||||
closest = origin + time * dirNormalized;
|
||||
return Vector2.Distance(point, closest);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
|
||||
+1
@@ -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 ====
|
||||
|
||||
|
||||
+1
@@ -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 ====
|
||||
|
||||
|
||||
+1
@@ -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 ====
|
||||
|
||||
|
||||
+1
@@ -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 ====
|
||||
|
||||
|
||||
@@ -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.1.0",
|
||||
"version": "5.2.2",
|
||||
"unity": "2020.3",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
Reference in New Issue
Block a user