alpha over and opacity nodes are now functional

This commit is contained in:
itsmattkc
2019-09-06 15:45:12 +10:00
parent a5fb8693d0
commit c2e59b0855
16 changed files with 104 additions and 19 deletions
+8 -6
View File
@@ -95,7 +95,7 @@ void RenderFramebuffer::Attach(RenderTexturePtr texture)
}
texture_ = texture;
AttachInternal(texture_->texture());
AttachInternal(texture_->texture(), false);
}
void RenderFramebuffer::AttachBackBuffer(RenderTexturePtr texture)
@@ -105,10 +105,7 @@ void RenderFramebuffer::AttachBackBuffer(RenderTexturePtr texture)
}
texture_ = texture;
AttachInternal(texture_->back_texture());
context_->functions()->glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
context_->functions()->glClear(GL_COLOR_BUFFER_BIT);
AttachInternal(texture_->back_texture(), true);
}
void RenderFramebuffer::Detach()
@@ -137,7 +134,7 @@ const GLuint &RenderFramebuffer::buffer() const
return buffer_;
}
void RenderFramebuffer::AttachInternal(GLuint tex)
void RenderFramebuffer::AttachInternal(GLuint tex, bool clear)
{
Detach();
@@ -150,6 +147,11 @@ void RenderFramebuffer::AttachInternal(GLuint tex)
GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tex, 0
);
if (clear) {
context_->functions()->glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
context_->functions()->glClear(GL_COLOR_BUFFER_BIT);
}
// release framebuffer
f->glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
}
+1 -1
View File
@@ -56,7 +56,7 @@ public slots:
void Destroy();
private:
void AttachInternal(GLuint tex);
void AttachInternal(GLuint tex, bool clear);
QOpenGLContext* context_;
+1
View File
@@ -77,6 +77,7 @@ bool RenderInstance::Start()
// Set viewport to the compositing dimensions
ctx_->functions()->glViewport(0, 0, width_, height_);
ctx_->functions()->glEnable(GL_BLEND);
// Set up default pipeline
default_pipeline_ = olive::ShaderGenerator::DefaultPipeline();