X-Git-Url: https://git.cinelerra-gg.org/git/?p=goodguy%2Fcinelerra.git;a=blobdiff_plain;f=cinelerra-5.1%2Fplugins%2Foverlay%2Foverlay.C;h=a77898f37ce988a53b89c0b452922bfd45681062;hp=8c0322050dcf98fc3e92356399186d49e2d54da8;hb=592d502d68e409919fb36a31ba60c23f57b00f35;hpb=9fed7535470aa37781733db836068da3b4c17a0d diff --git a/cinelerra-5.1/plugins/overlay/overlay.C b/cinelerra-5.1/plugins/overlay/overlay.C index 8c032205..a77898f3 100644 --- a/cinelerra-5.1/plugins/overlay/overlay.C +++ b/cinelerra-5.1/plugins/overlay/overlay.C @@ -485,20 +485,12 @@ int Overlay::handle_opengl() #undef TWO #define TWO 2.0 -static const char *blend_NORMAL_frag = - " vec4 result = mix(src_color, src_color, src_color.a);\n"; - -static const char *blend_ADDITION_frag = - " vec4 result = dst_color + src_color;\n" - " result = clamp(result, 0.0, 1.0);\n"; - -static const char *blend_SUBTRACT_frag = - " vec4 result = dst_color - src_color;\n" - " result = clamp(result, 0.0, 1.0);\n"; - static const char *blend_REPLACE_frag = " vec4 result = src_color;\n"; +GL_VEC_FRAG(NORMAL); +GL_VEC_FRAG(ADDITION); +GL_VEC_FRAG(SUBTRACT); GL_STD_FRAG(MULTIPLY); GL_VEC_FRAG(DIVIDE); GL_VEC_FRAG(MAX); @@ -572,21 +564,6 @@ static const char * const overlay_shaders[TRANSFER_TYPES] = { dst->init_screen(); src->draw_texture(); break; - case TRANSFER_NORMAL: -// Move destination to screen - if( dst->get_opengl_state() != VFrame::SCREEN ) { - dst->to_texture(); - dst->enable_opengl(); - dst->init_screen(); - dst->draw_texture(); - } - src->to_texture(); - dst->enable_opengl(); - dst->init_screen(); - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - src->draw_texture(); - break; default: src->to_texture(); dst->to_texture();