diff --git a/osu.Framework.Font/Graphics/Shaders/DefaultKaraokeLyricShader.cs b/osu.Framework.Font/Graphics/Shaders/DefaultKaraokeLyricShader.cs index 76700b1..d1f0922 100644 --- a/osu.Framework.Font/Graphics/Shaders/DefaultKaraokeLyricShader.cs +++ b/osu.Framework.Font/Graphics/Shaders/DefaultKaraokeLyricShader.cs @@ -17,25 +17,29 @@ public class DefaultKaraokeLyricShader : InternalShader public Color4 OutlineColour { get; set; } - public Vector2 ShaderOffset { get; set; } + public Vector2 ShadowOffset { get; set; } - public int ShaderSize { get; set; } + public int ShadowSize { get; set; } - public int ShaderSigma { get; set; } + public int ShadowSigma { get; set; } - public Vector2 ShaderColour { get; set; } + public Vector2 ShadowColour { get; set; } public override void ApplyValue(FrameBuffer current) { - var radius = Radius; - GetUniform(@"g_Radius").UpdateValue(ref radius); - + // outline effect var colourMatrix = new Vector4(Colour.R, Colour.G, Colour.B, Colour.A); GetUniform(@"g_Colour").UpdateValue(ref colourMatrix); + var radius = Radius; + GetUniform(@"g_Radius").UpdateValue(ref radius); + var outlineColourMatrix = new Vector4(OutlineColour.R, OutlineColour.G, OutlineColour.B, OutlineColour.A); GetUniform(@"g_OutlineColour").UpdateValue(ref outlineColourMatrix); + // shadow effect + + // common property. var size = current.Size; GetUniform(@"g_TexSize").UpdateValue(ref size); } diff --git a/osu.Framework.Font/Resources/Shaders/sh_DefaultKaraokeLyric.fs b/osu.Framework.Font/Resources/Shaders/sh_DefaultKaraokeLyric.fs index 2933753..d3ec773 100644 --- a/osu.Framework.Font/Resources/Shaders/sh_DefaultKaraokeLyric.fs +++ b/osu.Framework.Font/Resources/Shaders/sh_DefaultKaraokeLyric.fs @@ -7,8 +7,13 @@ varying mediump vec2 v_TexCoord; uniform lowp sampler2D m_Sampler; uniform mediump vec2 g_TexSize; + +// outline effect +uniform vec4 g_Colour; uniform int g_Radius; +uniform vec4 g_OutlineColour; +// shadow effect uniform mediump float g_Sigma; uniform highp vec2 g_BlurDirection;