Skip to content

Commit

Permalink
runnable.
Browse files Browse the repository at this point in the history
  • Loading branch information
andy840119 committed Apr 16, 2022
1 parent 928d642 commit 030bb8f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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; }

Expand All @@ -38,6 +38,11 @@ public override void ApplyValue(FrameBuffer current)
GetUniform<Vector4>(@"g_OutlineColour").UpdateValue(ref outlineColourMatrix);

// shadow effect
var shadowOffset = ShadowOffset;
GetUniform<Vector2>(@"g_BlurDirection").UpdateValue(ref shadowOffset);

var shadowSigma = ShadowSigma;
GetUniform<float>(@"g_Sigma").UpdateValue(ref shadowSigma);

// common property.
var size = current.Size;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 030bb8f

Please sign in to comment.