From 0188920556a5d32e19e93d1fcc038a591d7eb73c Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Sat, 1 Dec 2018 11:56:30 +1100 Subject: [PATCH] fixed alpha blending in some situations --- effects/internal/solideffect.cpp | 2 +- ui/viewerwidget.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/effects/internal/solideffect.cpp b/effects/internal/solideffect.cpp index ecf998ca9..0f888da61 100644 --- a/effects/internal/solideffect.cpp +++ b/effects/internal/solideffect.cpp @@ -50,7 +50,7 @@ SolidEffect::SolidEffect(Clip* c, const EffectMeta* em) : Effect(c, em) { void SolidEffect::redraw(double timecode) { int w = img.width(); int h = img.height(); - int alpha = (opacity_field->get_double_value(timecode)*2.55); + int alpha = qRound(opacity_field->get_double_value(timecode)*2.55); switch (solid_type->get_combo_data(timecode).toInt()) { case SOLID_TYPE_COLOR: { diff --git a/ui/viewerwidget.cpp b/ui/viewerwidget.cpp index 7329f2e9a..c01912839 100644 --- a/ui/viewerwidget.cpp +++ b/ui/viewerwidget.cpp @@ -36,7 +36,7 @@ extern "C" { #include } -#define GL_DEFAULT_BLEND glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_SRC_ALPHA, GL_ONE); +#define GL_DEFAULT_BLEND glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE); ViewerWidget::ViewerWidget(QWidget *parent) : QOpenGLWidget(parent), @@ -312,6 +312,7 @@ GLuint ViewerWidget::draw_clip(QOpenGLFramebufferObject* fbo, GLuint texture, bo fbo->bind(); if (clear) glClear(GL_COLOR_BUFFER_BIT); + GL_DEFAULT_BLEND glBindTexture(GL_TEXTURE_2D, texture); glBegin(GL_QUADS);