diff --git a/osu.Framework.Font/Graphics/Shaders/DefaultKaraokeLyricShader.cs b/osu.Framework.Font/Graphics/Shaders/DefaultKaraokeLyricShader.cs index d1f0922..cb737d9 100644 --- a/osu.Framework.Font/Graphics/Shaders/DefaultKaraokeLyricShader.cs +++ b/osu.Framework.Font/Graphics/Shaders/DefaultKaraokeLyricShader.cs @@ -21,7 +21,7 @@ public class DefaultKaraokeLyricShader : InternalShader public int ShadowSize { get; set; } - public int ShadowSigma { get; set; } + public float ShadowSigma { get; set; } public Vector2 ShadowColour { get; set; } @@ -38,6 +38,11 @@ public override void ApplyValue(FrameBuffer current) GetUniform(@"g_OutlineColour").UpdateValue(ref outlineColourMatrix); // shadow effect + var shadowOffset = ShadowOffset; + GetUniform(@"g_BlurDirection").UpdateValue(ref shadowOffset); + + var shadowSigma = ShadowSigma; + GetUniform(@"g_Sigma").UpdateValue(ref shadowSigma); // common property. var size = current.Size; diff --git a/osu.Framework.Font/Resources/Shaders/sh_DefaultKaraokeLyric.fs b/osu.Framework.Font/Resources/Shaders/sh_DefaultKaraokeLyric.fs index d3ec773..de6652d 100644 --- a/osu.Framework.Font/Resources/Shaders/sh_DefaultKaraokeLyric.fs +++ b/osu.Framework.Font/Resources/Shaders/sh_DefaultKaraokeLyric.fs @@ -45,5 +45,8 @@ lowp vec4 blur(sampler2D tex, int radius, highp vec2 direction, mediump vec2 tex void main(void) { - gl_FragColor = blur(m_Sampler, g_Radius, g_BlurDirection, v_TexCoord, g_TexSize, g_Sigma); + mediump vec4 originTexture = texture2D(m_Sampler, v_TexCoord) * g_Colour; + lowp vec4 outline = blur(m_Sampler, g_Radius, g_BlurDirection, v_TexCoord, g_TexSize, g_Sigma) * g_OutlineColour; + lowp vec4 shadow = blur(m_Sampler, g_Radius, g_BlurDirection, v_TexCoord, g_TexSize, g_Sigma); + gl_FragColor = originTexture; } \ No newline at end of file