This commit is contained in:
Yuxuan Shui 2020-03-15 20:24:30 +00:00
parent 7de9494766
commit 36e9ccd5be
No known key found for this signature in database
GPG Key ID: 37C999F617EA1A47
1 changed files with 3 additions and 2 deletions

View File

@ -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);