Skip to content

Commit

Permalink
rename and adjust property.
Browse files Browse the repository at this point in the history
  • Loading branch information
andy840119 committed Apr 16, 2022
1 parent d9a886f commit 928d642
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
18 changes: 11 additions & 7 deletions osu.Framework.Font/Graphics/Shaders/DefaultKaraokeLyricShader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>(@"g_Radius").UpdateValue(ref radius);

// outline effect
var colourMatrix = new Vector4(Colour.R, Colour.G, Colour.B, Colour.A);
GetUniform<Vector4>(@"g_Colour").UpdateValue(ref colourMatrix);

var radius = Radius;
GetUniform<int>(@"g_Radius").UpdateValue(ref radius);

var outlineColourMatrix = new Vector4(OutlineColour.R, OutlineColour.G, OutlineColour.B, OutlineColour.A);
GetUniform<Vector4>(@"g_OutlineColour").UpdateValue(ref outlineColourMatrix);

// shadow effect

// common property.
var size = current.Size;
GetUniform<Vector2>(@"g_TexSize").UpdateValue(ref size);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 928d642

Please sign in to comment.