reimplemented opacity without blending modes
This commit is contained in:
@@ -24,8 +24,6 @@
|
||||
#include "panels/timeline.h"
|
||||
#include "panels/viewer.h"
|
||||
|
||||
bool disable_blending = false;
|
||||
|
||||
extern "C" {
|
||||
#include <libavformat/avformat.h>
|
||||
}
|
||||
@@ -95,7 +93,7 @@ void process_effect(Clip* c,
|
||||
if (e->enable_coords) {
|
||||
e->process_coords(timecode, coords, data);
|
||||
}
|
||||
bool can_process_shaders = (e->enable_shader && shaders_are_enabled);
|
||||
bool can_process_shaders = (e->enable_shader && runtime_config.shaders_are_enabled);
|
||||
if (can_process_shaders || e->enable_superimpose) {
|
||||
e->startEffect();
|
||||
if (can_process_shaders && e->is_glsl_linked()) {
|
||||
@@ -489,7 +487,7 @@ GLuint compose_sequence(ComposeSequenceParams ¶ms) {
|
||||
|
||||
|
||||
// copy front buffer to back buffer (only if we're using blending modes - which we usually will be)
|
||||
if (!disable_blending) {
|
||||
if (!runtime_config.disable_blending) {
|
||||
if (params.nests.size() > 0) {
|
||||
draw_clip(params.ctx, params.nests.last()->fbo[2]->handle(), params.nests.last()->fbo[0]->texture(), true);
|
||||
} else {
|
||||
@@ -506,13 +504,17 @@ GLuint compose_sequence(ComposeSequenceParams ¶ms) {
|
||||
// bind front buffer as draw buffer
|
||||
params.ctx->functions()->glBindFramebuffer(GL_DRAW_FRAMEBUFFER, final_fbo);
|
||||
|
||||
if (disable_blending) {
|
||||
if (runtime_config.disable_blending) {
|
||||
// some GPUs don't like the blending shader, so we provide a pure GL fallback here
|
||||
|
||||
params.ctx->functions()->glBindTexture(GL_TEXTURE_2D, backend_tex_1);
|
||||
|
||||
glColor4f(coords.opacity, coords.opacity, coords.opacity, coords.opacity);
|
||||
|
||||
full_blit();
|
||||
|
||||
// glColor4f(1.0, 1.0, 1.0, 1.0);
|
||||
|
||||
params.ctx->functions()->glBindTexture(GL_TEXTURE_2D, 0);
|
||||
} else {
|
||||
// load background texture into texture unit 0
|
||||
|
||||
Reference in New Issue
Block a user