From b077d97ed706acbbdd3b20e765ec0552fa464f9b Mon Sep 17 00:00:00 2001 From: mob-sakai <12690315+mob-sakai@users.noreply.github.com> Date: Wed, 20 Aug 2025 08:38:58 +0900 Subject: [PATCH] fix: edges of `TransitionFilter.Shiny` appear sharp close #366 --- Packages/src/Shaders/UIEffect.cginc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Packages/src/Shaders/UIEffect.cginc b/Packages/src/Shaders/UIEffect.cginc index 356cb1d..b32d271 100644 --- a/Packages/src/Shaders/UIEffect.cginc +++ b/Packages/src/Shaders/UIEffect.cginc @@ -516,7 +516,7 @@ half4 apply_transition_filter(half4 color, const float alpha, const float2 uvLoc { const float factor = alpha - transition_rate() * (1 + _TransitionWidth) + _TransitionWidth; const float softness = max(0.0001, _TransitionWidth * _TransitionSoftness); - const half bandLerp = saturate((_TransitionWidth - factor) * 1 / softness); + const half bandLerp = saturate((_TransitionWidth - factor) * 2 / softness); const half softLerp = saturate(factor * 2 / softness); half4 bandColor = apply_transition_color_filter(half4(color.rgb, 1), half4(_TransitionColor.rgb, 1), _TransitionColor.a); @@ -540,7 +540,14 @@ half4 apply_transition_filter(half4 color, const float alpha, const float2 uvLoc } #endif - color = lerp(color, bandColor, bandLerp * softLerp); + half lerpFactor = bandLerp * softLerp; + #if TRANSITION_SHINY + { + lerpFactor *= lerpFactor; + } + #endif + + color = lerp(color, bandColor, lerpFactor); #if TRANSITION_DISSOLVE {