mirror of
https://github.com/mob-sakai/UIEffect.git
synced 2026-11-20 01:42:37 +08:00
Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 88261e2af0 | |||
| 791d867076 | |||
| 68ebae28e0 | |||
| 5cd48a4633 | |||
| 3ff52e4735 | |||
| a3773e3302 | |||
| 5a9f335bf8 | |||
| 3807e4c69a | |||
| 184967c120 | |||
| 2cca822413 | |||
| 90ab16c3fd | |||
| e1f3abf7a6 | |||
| 770e61bb12 | |||
| a0820bf847 |
@@ -5,14 +5,14 @@
|
||||
"depth": 0,
|
||||
"source": "git",
|
||||
"dependencies": {},
|
||||
"hash": "2045eaab5b485827cef8bf0bb9e1552dce4f8d6d"
|
||||
"hash": "4a182298bd6293c4e6e33dd40bb7a050847190d8"
|
||||
},
|
||||
"com.coffee.minimal-resource": {
|
||||
"version": "https://github.com/mob-sakai/Coffee.Internal.git?path=Packages/MinimalResource",
|
||||
"depth": 0,
|
||||
"source": "git",
|
||||
"dependencies": {},
|
||||
"hash": "2bd2bf356dd692a39de9db2ff11faaf79fbfaea3"
|
||||
"hash": "4a182298bd6293c4e6e33dd40bb7a050847190d8"
|
||||
},
|
||||
"com.coffee.nano-monitor": {
|
||||
"version": "https://github.com/mob-sakai/Coffee.Internal.git?path=Packages/NanoMonitor",
|
||||
@@ -21,14 +21,14 @@
|
||||
"dependencies": {
|
||||
"com.unity.ugui": "1.0.0"
|
||||
},
|
||||
"hash": "2045eaab5b485827cef8bf0bb9e1552dce4f8d6d"
|
||||
"hash": "4a182298bd6293c4e6e33dd40bb7a050847190d8"
|
||||
},
|
||||
"com.coffee.symbolic-linker": {
|
||||
"version": "https://github.com/mob-sakai/Coffee.Internal.git?path=Packages/SymbolicLinker",
|
||||
"depth": 0,
|
||||
"source": "git",
|
||||
"dependencies": {},
|
||||
"hash": "3c280f1a8f4db5038b881ff07f270efd9638fa31"
|
||||
"hash": "4a182298bd6293c4e6e33dd40bb7a050847190d8"
|
||||
},
|
||||
"com.coffee.ui-effect": {
|
||||
"version": "file:src",
|
||||
|
||||
@@ -1,3 +1,35 @@
|
||||
## [5.8.5](https://github.com/mob-sakai/UIEffect/compare/5.8.4...5.8.5) (2025-05-22)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* skip processing when graphic is invalid ([5cd48a4](https://github.com/mob-sakai/UIEffect/commit/5cd48a463309270ec3d6501bde2add9944bbaf02))
|
||||
* TextMeshPro strikethrough and underline not displaying ([68ebae2](https://github.com/mob-sakai/UIEffect/commit/68ebae28e02045cb45996bf5b77d7d93d2f0ca82)), closes [#344](https://github.com/mob-sakai/UIEffect/issues/344)
|
||||
* TMP SubMeshUI generates overhead every frame (since 5.6.0) ([791d867](https://github.com/mob-sakai/UIEffect/commit/791d8670761902466d81412d832cddf013cd28cd)), closes [#343](https://github.com/mob-sakai/UIEffect/issues/343) [#345](https://github.com/mob-sakai/UIEffect/issues/345)
|
||||
|
||||
## [5.8.4](https://github.com/mob-sakai/UIEffect/compare/5.8.3...5.8.4) (2025-04-30)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* NRE while canvas is disabled ([a3773e3](https://github.com/mob-sakai/UIEffect/commit/a3773e33028c60517fb4e6c534f6280194df8e64)), closes [#342](https://github.com/mob-sakai/UIEffect/issues/342)
|
||||
|
||||
## [5.8.3](https://github.com/mob-sakai/UIEffect/compare/5.8.2...5.8.3) (2025-04-30)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* the alpha of the gradation color and gradient was being ignored ([3807e4c](https://github.com/mob-sakai/UIEffect/commit/3807e4c69aefaef04b2245522e7c5085ccc65a36)), closes [#341](https://github.com/mob-sakai/UIEffect/issues/341)
|
||||
|
||||
## [5.8.2](https://github.com/mob-sakai/UIEffect/compare/5.8.1...5.8.2) (2025-04-23)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* `Flip` is ignored when loading a preset ([e1f3abf](https://github.com/mob-sakai/UIEffect/commit/e1f3abf7a65b62718b28e33ac2f7d700c3ae3f5a))
|
||||
* fix detail color ([90ab16c](https://github.com/mob-sakai/UIEffect/commit/90ab16c3fd46435ebf7c8e47ffb4ec521d2f61c9))
|
||||
* indicate in the inspector using tooltips and asterisks that `Rotation` and `Keep Aspect Ratio` are shared properties ([2cca822](https://github.com/mob-sakai/UIEffect/commit/2cca822413aa7580e1eb777c3295d1de928cd65f))
|
||||
|
||||
## [5.8.1](https://github.com/mob-sakai/UIEffect/compare/5.8.0...5.8.1) (2025-04-17)
|
||||
|
||||
|
||||
|
||||
@@ -101,6 +101,8 @@ namespace Coffee.UIEffects.Editors
|
||||
private SerializedProperty _detailTexSpeed;
|
||||
|
||||
private SerializedProperty _flip;
|
||||
private static GUIContent s_RotationLabel = new GUIContent("* Rotation");
|
||||
private static GUIContent s_KeepAspectRatioLabel = new GUIContent("* Keep Aspect Ratio");
|
||||
|
||||
protected virtual void OnEnable()
|
||||
{
|
||||
@@ -134,6 +136,9 @@ namespace Coffee.UIEffects.Editors
|
||||
_transitionPatternReverse = serializedObject.FindProperty("m_TransitionPatternReverse");
|
||||
_transitionAutoPlaySpeed = serializedObject.FindProperty("m_TransitionAutoPlaySpeed");
|
||||
|
||||
s_RotationLabel.tooltip = _transitionRotation.tooltip;
|
||||
s_KeepAspectRatioLabel.tooltip = _transitionKeepAspectRatio.tooltip;
|
||||
|
||||
_targetMode = serializedObject.FindProperty("m_TargetMode");
|
||||
_targetColor = serializedObject.FindProperty("m_TargetColor");
|
||||
_targetRange = serializedObject.FindProperty("m_TargetRange");
|
||||
@@ -251,9 +256,8 @@ namespace Coffee.UIEffects.Editors
|
||||
EditorApplication.QueuePlayerLoopUpdate();
|
||||
}
|
||||
|
||||
EditorGUILayout.PropertyField(_transitionRotation, EditorGUIUtility.TrTempContent("Rotation"));
|
||||
EditorGUILayout.PropertyField(_transitionKeepAspectRatio,
|
||||
EditorGUIUtility.TrTempContent("Keep Aspect Ratio"));
|
||||
EditorGUILayout.PropertyField(_transitionRotation, s_RotationLabel);
|
||||
EditorGUILayout.PropertyField(_transitionKeepAspectRatio, s_KeepAspectRatioLabel);
|
||||
EditorGUILayout.PropertyField(_transitionReverse, EditorGUIUtility.TrTempContent("Reverse"));
|
||||
EditorGUI.indentLevel--;
|
||||
|
||||
@@ -387,8 +391,7 @@ namespace Coffee.UIEffects.Editors
|
||||
EditorGUILayout.PropertyField(_gradationRotation);
|
||||
}
|
||||
|
||||
EditorGUILayout.PropertyField(_transitionKeepAspectRatio,
|
||||
EditorGUIUtility.TrTempContent("Keep Aspect Ratio"));
|
||||
EditorGUILayout.PropertyField(_transitionKeepAspectRatio, s_KeepAspectRatioLabel);
|
||||
EditorGUI.indentLevel--;
|
||||
}
|
||||
|
||||
@@ -442,9 +445,8 @@ namespace Coffee.UIEffects.Editors
|
||||
EditorApplication.QueuePlayerLoopUpdate();
|
||||
}
|
||||
|
||||
EditorGUILayout.PropertyField(_transitionRotation, EditorGUIUtility.TrTempContent("Rotation"));
|
||||
EditorGUILayout.PropertyField(_transitionKeepAspectRatio,
|
||||
EditorGUIUtility.TrTempContent("Keep Aspect Ratio"));
|
||||
EditorGUILayout.PropertyField(_transitionRotation, s_RotationLabel);
|
||||
EditorGUILayout.PropertyField(_transitionKeepAspectRatio, s_KeepAspectRatioLabel);
|
||||
EditorGUI.indentLevel--;
|
||||
EditorGUI.indentLevel--;
|
||||
}
|
||||
|
||||
@@ -282,7 +282,7 @@ namespace Coffee.UIEffectInternal
|
||||
_errorOnUnregisteredVariant = property.FindPropertyRelative("m_ErrorOnUnregisteredVariant");
|
||||
_asset = property.FindPropertyRelative("m_Asset");
|
||||
|
||||
_rlOptionalShaders = new ReorderableList(so, optionalShaders, false, true, true, true);
|
||||
_rlOptionalShaders = new ReorderableList(so, optionalShaders, true, true, true, true);
|
||||
_rlOptionalShaders.drawHeaderCallback = rect =>
|
||||
{
|
||||
var rLabel = new Rect(rect.x, rect.y, rect.width - 80, rect.height);
|
||||
@@ -302,12 +302,10 @@ namespace Coffee.UIEffectInternal
|
||||
optionalShaders.ClearArray();
|
||||
}
|
||||
};
|
||||
_rlOptionalShaders.elementHeightCallback = _ => _expandOptionalShaders
|
||||
? EditorGUIUtility.singleLineHeight * 2 + 4
|
||||
: 0;
|
||||
_rlOptionalShaders.elementHeight = EditorGUIUtility.singleLineHeight * 2 + 4;
|
||||
_rlOptionalShaders.drawElementCallback = (r, index, isActive, isFocused) =>
|
||||
{
|
||||
if (optionalShaders.arraySize <= index || !_expandOptionalShaders) return;
|
||||
if (optionalShaders.arraySize <= index) return;
|
||||
|
||||
var element = optionalShaders.GetArrayElementAtIndex(index);
|
||||
if (element == null) return;
|
||||
@@ -322,7 +320,7 @@ namespace Coffee.UIEffectInternal
|
||||
}
|
||||
|
||||
var rArrow = new Rect(r.x, r.y + h + 4, 20, h);
|
||||
EditorGUI.LabelField(rArrow, "->");
|
||||
EditorGUI.LabelField(rArrow, GUIContent.none, "ArrowNavigationRight");
|
||||
|
||||
var rValue = new Rect(r.x + 20, r.y + h + 4, r.width - 20, h);
|
||||
if (GUI.Button(rValue, value.stringValue, EditorStyles.popup))
|
||||
|
||||
@@ -69,10 +69,14 @@ namespace Coffee.UIEffects
|
||||
[SerializeField]
|
||||
protected Vector2 m_TransitionTexSpeed = new Vector2(0, 0);
|
||||
|
||||
[Tooltip("Effect rotation (0–360).\n" +
|
||||
"NOTE: This property is shared between `Transition Filter` and `Detail Filter`.")]
|
||||
[SerializeField]
|
||||
[Range(0, 360)]
|
||||
private float m_TransitionRotation = 0;
|
||||
|
||||
[Tooltip("The effect maintains its aspect ratio.\n" +
|
||||
"NOTE: This property is shared between `Transition Filter`, `Gradation Mode`, and `Detail Filter`.")]
|
||||
[SerializeField]
|
||||
protected bool m_TransitionKeepAspectRatio = true;
|
||||
|
||||
@@ -1393,13 +1397,13 @@ namespace Coffee.UIEffects
|
||||
set => m_CustomRoot = value;
|
||||
}
|
||||
|
||||
public override Flip flip
|
||||
public Flip flip
|
||||
{
|
||||
get => m_Flip;
|
||||
set
|
||||
{
|
||||
if (m_Flip == value) return;
|
||||
m_Flip = value;
|
||||
context.m_Flip = m_Flip = value;
|
||||
SetVerticesDirty();
|
||||
}
|
||||
}
|
||||
@@ -1714,6 +1718,11 @@ namespace Coffee.UIEffects
|
||||
dst.m_DetailTexSpeed = src.m_DetailTexSpeed;
|
||||
}
|
||||
|
||||
if (!append || src.m_Flip != 0)
|
||||
{
|
||||
dst.m_Flip = append ? dst.m_Flip | src.m_Flip : src.m_Flip;
|
||||
}
|
||||
|
||||
Misc.SetDirty(dst);
|
||||
UpdateContext(context);
|
||||
SetVerticesDirty();
|
||||
@@ -1838,6 +1847,11 @@ namespace Coffee.UIEffects
|
||||
dst.m_DetailTexSpeed = src.m_DetailTexSpeed;
|
||||
}
|
||||
|
||||
if (!append || src.m_Flip != 0)
|
||||
{
|
||||
dst.m_Flip = append ? dst.m_Flip | src.m_Flip : src.m_Flip;
|
||||
}
|
||||
|
||||
Misc.SetDirty(dst);
|
||||
UpdateContext(context);
|
||||
SetVerticesDirty();
|
||||
@@ -1960,6 +1974,11 @@ namespace Coffee.UIEffects
|
||||
dst.m_DetailTexSpeed = src.m_DetailTexSpeed;
|
||||
}
|
||||
|
||||
if (!append || src.m_Flip != 0)
|
||||
{
|
||||
dst.m_Flip = append ? dst.m_Flip | src.m_Flip : src.m_Flip;
|
||||
}
|
||||
|
||||
Misc.SetDirty(dst);
|
||||
}
|
||||
|
||||
@@ -2044,6 +2063,8 @@ namespace Coffee.UIEffects
|
||||
dst.m_DetailTexScale = src.m_DetailTexScale;
|
||||
dst.m_DetailTexOffset = src.m_DetailTexOffset;
|
||||
dst.m_DetailTexSpeed = src.m_DetailTexSpeed;
|
||||
|
||||
dst.m_Flip = src.m_Flip;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,14 +62,9 @@ namespace Coffee.UIEffects
|
||||
|
||||
public virtual RectTransform transitionRoot => transform as RectTransform;
|
||||
|
||||
public virtual Flip flip
|
||||
{
|
||||
get => 0;
|
||||
set { }
|
||||
}
|
||||
|
||||
protected override void OnEnable()
|
||||
{
|
||||
_canModifyMesh = true;
|
||||
_onBeforeCanvasRebuild ??= OnBeforeCanvasRebuild;
|
||||
_onAfterCanvasRebuild ??= OnAfterCanvasRebuild;
|
||||
UIExtraCallbacks.onBeforeCanvasRebuild += _onBeforeCanvasRebuild;
|
||||
@@ -105,17 +100,19 @@ namespace Coffee.UIEffects
|
||||
|
||||
protected virtual void OnBeforeCanvasRebuild()
|
||||
{
|
||||
// If the mesh is not modified in the previous frame, try to modify it if possible.
|
||||
if (!_canModifyMesh && CanModifyMesh())
|
||||
{
|
||||
_canModifyMesh = true;
|
||||
SetVerticesDirty();
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void OnAfterCanvasRebuild()
|
||||
{
|
||||
if (!_material || !graphic || context == null) return;
|
||||
if (!_material || !graphic || !graphic.canvas || context == null) return;
|
||||
|
||||
context.UpdateViewMatrix(GetCurrentMaterial(), transitionRoot, graphic.canvas.rootCanvas, flip);
|
||||
context.UpdateViewMatrix(GetCurrentMaterial(), transitionRoot, graphic.canvas.rootCanvas);
|
||||
}
|
||||
|
||||
public void ModifyMesh(Mesh mesh)
|
||||
@@ -129,12 +126,14 @@ namespace Coffee.UIEffects
|
||||
_canModifyMesh = CanModifyMesh();
|
||||
if (_canModifyMesh)
|
||||
{
|
||||
context.ModifyMesh(graphic, transitionRoot, vh, canModifyShape, flip);
|
||||
context.ModifyMesh(graphic, transitionRoot, vh, canModifyShape);
|
||||
}
|
||||
}
|
||||
|
||||
private bool CanModifyMesh()
|
||||
{
|
||||
if (!graphic || !graphic.isActiveAndEnabled) return false;
|
||||
|
||||
// The transitionRoot is same as the transform => true.
|
||||
var root = transitionRoot;
|
||||
if (transform == root) return true;
|
||||
|
||||
@@ -238,6 +238,8 @@ namespace Coffee.UIEffects
|
||||
public Vector2 m_DetailTexOffset;
|
||||
public Vector2 m_DetailTexSpeed;
|
||||
|
||||
public Flip m_Flip;
|
||||
|
||||
public bool willModifyMaterial => m_ToneFilter != ToneFilter.None
|
||||
|| m_ColorFilter != ColorFilter.None
|
||||
|| m_SamplingFilter != SamplingFilter.None
|
||||
@@ -383,6 +385,8 @@ namespace Coffee.UIEffects
|
||||
dst.m_DetailTexScale = src.m_DetailTexScale;
|
||||
dst.m_DetailTexOffset = src.m_DetailTexOffset;
|
||||
dst.m_DetailTexSpeed = src.m_DetailTexSpeed;
|
||||
|
||||
dst.m_Flip = src.m_Flip;
|
||||
}
|
||||
|
||||
public void SetGradationDirty()
|
||||
@@ -520,7 +524,7 @@ namespace Coffee.UIEffects
|
||||
material.SetFloat(s_EdgeShinyAutoPlaySpeed, enable ? m_EdgeShinyAutoPlaySpeed : 0);
|
||||
}
|
||||
|
||||
public void UpdateViewMatrix(Material material, RectTransform transitionRoot, Canvas canvas, Flip flip)
|
||||
public void UpdateViewMatrix(Material material, RectTransform transitionRoot, Canvas canvas)
|
||||
{
|
||||
if (!material) return;
|
||||
|
||||
@@ -531,10 +535,10 @@ namespace Coffee.UIEffects
|
||||
scale.x = scale.y = Mathf.Min(scale.x, scale.y);
|
||||
}
|
||||
|
||||
if (0 != (flip & Flip.Effect))
|
||||
if (0 != (m_Flip & Flip.Effect))
|
||||
{
|
||||
scale.x = 0 != (flip & Flip.Horizontal) ? -scale.x : scale.x;
|
||||
scale.y = 0 != (flip & Flip.Vertical) ? -scale.y : scale.y;
|
||||
scale.x = 0 != (m_Flip & Flip.Horizontal) ? -scale.x : scale.x;
|
||||
scale.y = 0 != (m_Flip & Flip.Vertical) ? -scale.y : scale.y;
|
||||
}
|
||||
|
||||
var pivot = new Vector2(0.5f, 0.5f);
|
||||
@@ -635,11 +639,10 @@ namespace Coffee.UIEffects
|
||||
}
|
||||
}
|
||||
|
||||
public void ModifyMesh(Graphic graphic, RectTransform transitionRoot, VertexHelper vh,
|
||||
bool canModifyShape, Flip flip)
|
||||
public void ModifyMesh(Graphic graphic, RectTransform transitionRoot, VertexHelper vh, bool canModifyShape)
|
||||
{
|
||||
// Apply flip (without effect).
|
||||
ApplyFlipWithoutEffect(vh, flip);
|
||||
ApplyFlipWithoutEffect(vh, m_Flip);
|
||||
|
||||
var count = vh.currentIndexCount;
|
||||
if (!willModifyVertex || count == 0) return;
|
||||
@@ -678,10 +681,10 @@ namespace Coffee.UIEffects
|
||||
}
|
||||
|
||||
// Apply flip (with effect).
|
||||
ApplyFlipWithEffect(verts, flip);
|
||||
ApplyFlipWithEffect(verts, m_Flip);
|
||||
|
||||
// Apply shadow.
|
||||
ApplyShadow(verts, transitionRoot, flip);
|
||||
ApplyShadow(verts, transitionRoot, m_Flip);
|
||||
|
||||
vh.Clear();
|
||||
vh.AddUIVertexTriangleStream(verts);
|
||||
|
||||
@@ -171,6 +171,8 @@ namespace Coffee.UIEffects
|
||||
dst.m_DetailTexScale = src.m_DetailTexScale;
|
||||
dst.m_DetailTexOffset = src.m_DetailTexOffset;
|
||||
dst.m_DetailTexSpeed = src.m_DetailTexSpeed;
|
||||
|
||||
dst.m_Flip = src.m_Flip;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,8 +95,6 @@ namespace Coffee.UIEffects
|
||||
}
|
||||
}
|
||||
|
||||
public override Flip flip => target ? target.flip : 0;
|
||||
|
||||
public override float actualSamplingScale => Mathf.Clamp(m_SamplingScale, 0.01f, 100);
|
||||
|
||||
public override bool canModifyShape => m_AllowToModifyMeshShape;
|
||||
|
||||
@@ -226,7 +226,7 @@ namespace Coffee.UIEffects
|
||||
{
|
||||
var meshInfo = textMeshProUGUI.textInfo.meshInfo[i];
|
||||
s_VertexHelper.Clear();
|
||||
meshInfo.mesh.CopyTo(s_VertexHelper, meshInfo.vertexCount, meshInfo.vertexCount * 6 / 4);
|
||||
meshInfo.mesh.CopyTo(s_VertexHelper);
|
||||
if (i == 0)
|
||||
{
|
||||
foreach (var modifier in modifiers)
|
||||
@@ -254,7 +254,6 @@ namespace Coffee.UIEffects
|
||||
replica.target = pEffect;
|
||||
replica.useTargetTransform = true;
|
||||
replica.customRoot = null;
|
||||
replica.flip = pEffect.flip;
|
||||
}
|
||||
else if (effect is UIEffectReplica pReplica && pReplica.isActiveAndEnabled)
|
||||
{
|
||||
@@ -262,7 +261,6 @@ namespace Coffee.UIEffects
|
||||
replica.preset = pReplica.preset;
|
||||
replica.useTargetTransform = pReplica.useTargetTransform;
|
||||
replica.customRoot = pReplica.customRoot;
|
||||
replica.flip = pReplica.flip;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -592,26 +592,28 @@ half4 apply_gradation_filter(const half4 inColor, const float2 uvGrad)
|
||||
if (mode == 1) // Color.Multiply
|
||||
{
|
||||
color.rgb = color.rgb * factor.rgb;
|
||||
color *= factor.a;
|
||||
}
|
||||
else if (mode == 2) // Color.Additive
|
||||
{
|
||||
color.rgb = color.rgb + factor.rgb * color.a;
|
||||
color.rgb = color.rgb + factor.rgb * color.a * factor.a;
|
||||
}
|
||||
else if (mode == 3) // Color.Subtractive
|
||||
{
|
||||
color.rgb = color.rgb - factor.rgb * color.a;
|
||||
color.rgb = color.rgb - factor.rgb * color.a * factor.a;
|
||||
}
|
||||
else if (mode == 4) // Color.Replace
|
||||
{
|
||||
color.rgb = factor.rgb * color.a;
|
||||
color *= factor.a;
|
||||
}
|
||||
else if (mode == 5) // Color.MultiplyLuminance
|
||||
{
|
||||
color.rgb = (1 + Luminance(color.rgb)) * factor.rgb / 2 * color.a;
|
||||
color.rgb = (1 + Luminance(color.rgb)) * factor.rgb * factor.a / 2 * color.a;
|
||||
}
|
||||
else if (mode == 6) // Color.MultiplyAdditive
|
||||
{
|
||||
color.rgb = color.rgb * (1 + factor.rgb);
|
||||
color.rgb = color.rgb * (1 + factor.rgb * factor.a);
|
||||
}
|
||||
|
||||
if (0 < mode)
|
||||
@@ -629,25 +631,25 @@ half4 apply_detail_filter(half4 color, float2 uvLocal)
|
||||
half4 detail = tex2D(_DetailTex, uv);
|
||||
#if DETAIL_MASKING // Detail.Masking
|
||||
{
|
||||
color *= inv_lerp(_DetailThreshold.x, _DetailThreshold.y, detail.a);
|
||||
color.a *= inv_lerp(_DetailThreshold.x, _DetailThreshold.y, detail.a);
|
||||
}
|
||||
#elif DETAIL_MULTIPLY // Detail.Multiply
|
||||
{
|
||||
detail *= _DetailColor;
|
||||
color.rgb *= detail.rgb;
|
||||
color = lerp(inColor, color * detail.a, _DetailIntensity);
|
||||
color = lerp(inColor, color, _DetailIntensity * detail.a);
|
||||
}
|
||||
#elif DETAIL_ADDITIVE // Detail.Additive
|
||||
{
|
||||
detail *= _DetailColor;
|
||||
color.rgb += detail.rgb * detail.a * color.a;
|
||||
color = lerp(inColor, color, _DetailIntensity);
|
||||
color.rgb += detail.rgb * color.a;
|
||||
color = lerp(inColor, color, _DetailIntensity * detail.a);
|
||||
}
|
||||
#elif DETAIL_SUBTRACTIVE // Detail.Subtractive
|
||||
{
|
||||
detail *= _DetailColor;
|
||||
color.rgb -= detail.rgb * detail.a * color.a;
|
||||
color = lerp(inColor, color, _DetailIntensity);
|
||||
color.rgb -= detail.rgb * color.a;
|
||||
color = lerp(inColor, color, _DetailIntensity * detail.a);
|
||||
}
|
||||
#elif DETAIL_REPLACE // Detail.Replace
|
||||
{
|
||||
@@ -658,8 +660,8 @@ half4 apply_detail_filter(half4 color, float2 uvLocal)
|
||||
#elif DETAIL_MULTIPLY_ADDITIVE // Detail.MultiplyAdditive
|
||||
{
|
||||
detail *= _DetailColor;
|
||||
color.rgb *= (1 + detail.rgb * detail.a);
|
||||
color = lerp(inColor, color, _DetailIntensity);
|
||||
color.rgb *= (1 + detail.rgb);
|
||||
color = lerp(inColor, color, _DetailIntensity * detail.a);
|
||||
}
|
||||
#else
|
||||
{
|
||||
|
||||
@@ -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.8.1",
|
||||
"version": "5.8.5",
|
||||
"unity": "2020.3",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
Reference in New Issue
Block a user