fixed bug where superimpose effect alpha affected whole clip alpha

This commit is contained in:
itsmattkc
2018-11-29 23:13:32 +11:00
parent 34260674b3
commit bb9861da25
3 changed files with 13 additions and 9 deletions
+1 -1
View File
@@ -1504,7 +1504,7 @@ void TimelineWidget::update_ghosts(const QPoint& mouse_pos, bool lock_frame) {
if (panel_timeline->importing) { if (panel_timeline->importing) {
QToolTip::showText(mapToGlobal(mouse_pos), frame_to_timecode(earliest_in_point, config.timecode_view, sequence->frame_rate)); QToolTip::showText(mapToGlobal(mouse_pos), frame_to_timecode(earliest_in_point, config.timecode_view, sequence->frame_rate));
} else { } else {
QString tip = ((frame_diff < 0) ? "-" : "+") + frame_to_timecode(qAbs(frame_diff), config.timecode_view, sequence->frame_rate); QString tip = ((frame_diff < 0) ? "-" : "+") + frame_to_timecode(qAbs(frame_diff), config.timecode_view, sequence->frame_rate);
if (panel_timeline->trim_target > -1) { if (panel_timeline->trim_target > -1) {
// find which clip is being moved // find which clip is being moved
+11 -7
View File
@@ -285,16 +285,16 @@ void ViewerWidget::drawTitleSafeArea() {
} }
GLuint ViewerWidget::draw_clip(QOpenGLFramebufferObject* fbo, GLuint texture, bool clear) { GLuint ViewerWidget::draw_clip(QOpenGLFramebufferObject* fbo, GLuint texture, bool clear) {
glPushMatrix(); glPushMatrix();
glLoadIdentity(); glLoadIdentity();
glOrtho(0, 1, 0, 1, -1, 1); glOrtho(0, 1, 0, 1, -1, 1);
fbo->bind(); fbo->bind();
if (clear) glClear(GL_COLOR_BUFFER_BIT); if (clear) glClear(GL_COLOR_BUFFER_BIT);
glBindTexture(GL_TEXTURE_2D, texture); glBindTexture(GL_TEXTURE_2D, texture);
glBegin(GL_QUADS); glBegin(GL_QUADS);
glTexCoord2f(0, 0); // top left glTexCoord2f(0, 0); // top left
glVertex2f(0, 0); // top left glVertex2f(0, 0); // top left
glTexCoord2f(1, 0); // top right glTexCoord2f(1, 0); // top right
@@ -327,7 +327,11 @@ void ViewerWidget::process_effect(Clip* c, Effect* e, double timecode, GLTexture
} }
if (e->enable_superimpose) { if (e->enable_superimpose) {
GLuint superimpose_texture = e->process_superimpose(timecode); GLuint superimpose_texture = e->process_superimpose(timecode);
if (superimpose_texture != 0) composite_texture = draw_clip(c->fbo[!fbo_switcher], superimpose_texture, false); if (superimpose_texture != 0) {
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
composite_texture = draw_clip(c->fbo[!fbo_switcher], superimpose_texture, false);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
}
} }
} }
} }