X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=luma_mix_effect.cpp;fp=luma_mix_effect.cpp;h=e34d87f167376cfae61f43f854845995ab3da000;hb=36d9ece323c89dbd553644c80fea449c5dd1e685;hp=0000000000000000000000000000000000000000;hpb=b65b7cace3efb474a378e65d395f278307c1c44c;p=movit diff --git a/luma_mix_effect.cpp b/luma_mix_effect.cpp new file mode 100644 index 0000000..e34d87f --- /dev/null +++ b/luma_mix_effect.cpp @@ -0,0 +1,27 @@ +#include "luma_mix_effect.h" +#include "effect_util.h" +#include "util.h" + +using namespace std; + +namespace movit { + +LumaMixEffect::LumaMixEffect() + : transition_width(1.0f), progress(0.5f) +{ + register_float("transition_width", &transition_width); + register_float("progress", &progress); +} + +string LumaMixEffect::output_fragment_shader() +{ + return read_file("luma_mix_effect.frag"); +} + +void LumaMixEffect::set_gl_state(GLuint glsl_program_num, const string &prefix, unsigned *sampler_num) +{ + Effect::set_gl_state(glsl_program_num, prefix, sampler_num); + set_uniform_float(glsl_program_num, prefix, "progress_mul_w_plus_one", progress * (transition_width + 1.0)); +} + +} // namespace movit