]> git.sesse.net Git - movit/blob - luma_mix_effect.cpp
Make the ResourcePool hold FBOs as a per-context resource.
[movit] / luma_mix_effect.cpp
1 #include "luma_mix_effect.h"
2 #include "effect_util.h"
3 #include "util.h"
4
5 using namespace std;
6
7 namespace movit {
8
9 LumaMixEffect::LumaMixEffect()
10         : transition_width(1.0f), progress(0.5f)
11 {
12         register_float("transition_width", &transition_width);
13         register_float("progress", &progress);
14 }
15
16 string LumaMixEffect::output_fragment_shader()
17 {
18         return read_file("luma_mix_effect.frag");
19 }
20
21 void LumaMixEffect::set_gl_state(GLuint glsl_program_num, const string &prefix, unsigned *sampler_num)
22 {
23         Effect::set_gl_state(glsl_program_num, prefix, sampler_num);
24         set_uniform_float(glsl_program_num, prefix, "progress_mul_w_plus_one", progress * (transition_width + 1.0));
25 }
26
27 }  // namespace movit