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
@@ -28,7 +28,7 @@
#define BLEND_MODE_MULTIPLY 2
#define BLEND_MODE_OVERLAY 3
TransformEffect::TransformEffect(Clip* c, const EffectMeta* em) : Effect(c, em) {
TransformEffect::TransformEffect(Clip* c, const EffectMeta* em) : Effect(c, em) {
enable_coords = true;
EffectRow* position_row = add_row("Position:");
+1 -1
View File
@@ -1504,7 +1504,7 @@ void TimelineWidget::update_ghosts(const QPoint& mouse_pos, bool lock_frame) {
if (panel_timeline->importing) {
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);
if (panel_timeline->trim_target > -1) {
// 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) {
glPushMatrix();
glLoadIdentity();
glOrtho(0, 1, 0, 1, -1, 1);
glPushMatrix();
glLoadIdentity();
glOrtho(0, 1, 0, 1, -1, 1);
fbo->bind();
fbo->bind();
if (clear) glClear(GL_COLOR_BUFFER_BIT);
glBindTexture(GL_TEXTURE_2D, texture);
glBegin(GL_QUADS);
glBindTexture(GL_TEXTURE_2D, texture);
glBegin(GL_QUADS);
glTexCoord2f(0, 0); // top left
glVertex2f(0, 0); // top left
glTexCoord2f(1, 0); // top right
@@ -327,7 +327,11 @@ void ViewerWidget::process_effect(Clip* c, Effect* e, double timecode, GLTexture
}
if (e->enable_superimpose) {
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);
}
}
}
}