From 36e9ccd5bec97b7757fec79a25a0e9614018af73 Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Sun, 15 Mar 2020 20:24:30 +0000 Subject: [PATCH] tmp --- src/backend/gl/gl_common.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/backend/gl/gl_common.c b/src/backend/gl/gl_common.c index 9710baa..eb13f44 100644 --- a/src/backend/gl/gl_common.c +++ b/src/backend/gl/gl_common.c @@ -1358,8 +1358,9 @@ static inline void gl_image_decouple(backend_t *base, struct gl_image *img) { static void gl_image_apply_alpha(backend_t *base, struct gl_image *img, const region_t *reg_op, double alpha) { - glBlendFunc(GL_ONE, GL_CONSTANT_COLOR); - glBlendColor((GLclampf)alpha, (GLclampf)alpha, (GLclampf)alpha, (GLclampf)alpha); + // Result color = 0 (GL_ZERO) + alpha (GL_CONSTANT_ALPHA) * original color + glBlendFunc(GL_ZERO, GL_CONSTANT_ALPHA); + glBlendColor(0, 0, 0, (GLclampf)alpha); GLuint fbo; glGenFramebuffers(1, &fbo); glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fbo);