Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,7 @@ class AssSubtitleTextureView : TextureView, AssSubtitleRender, TextureView.Surfa
uniform vec4 u_Color;
void main() {
float alpha = texture2D(u_Texture, v_TexCoord).a;
gl_FragColor = u_Color * alpha;

gl_FragColor = vec4(u_Color.rgb, u_Color.a * alpha);
}
""".trimIndent()

Expand Down Expand Up @@ -290,7 +289,7 @@ class AssSubtitleTextureView : TextureView, AssSubtitleRender, TextureView.Surfa
// enable blend
GLES20.glEnable(GLES20.GL_BLEND)
// set blend mode
GLES20.glBlendFunc(GLES20.GL_SRC_ALPHA, GLES20.GL_ONE_MINUS_SRC_ALPHA)
GLES20.glBlendFuncSeparate(GLES20.GL_SRC_ALPHA, GLES20.GL_ONE_MINUS_SRC_ALPHA, GLES20.GL_ONE, GLES20.GL_ONE_MINUS_SRC_ALPHA)
}

override fun onSurfaceChanged(width: Int, height: Int) {
Expand Down