4 #include "effect_util.h"
5 #include "lift_gamma_gain_effect.h"
12 LiftGammaGainEffect::LiftGammaGainEffect()
13 : lift(0.0f, 0.0f, 0.0f),
14 gamma(1.0f, 1.0f, 1.0f),
15 gain(1.0f, 1.0f, 1.0f)
17 register_vec3("lift", (float *)&lift);
18 register_vec3("gamma", (float *)&gamma);
19 register_vec3("gain", (float *)&gain);
22 string LiftGammaGainEffect::output_fragment_shader()
24 return read_file("lift_gamma_gain_effect.frag");
27 void LiftGammaGainEffect::set_gl_state(GLuint glsl_program_num, const string &prefix, unsigned *sampler_num)
29 Effect::set_gl_state(glsl_program_num, prefix, sampler_num);
31 RGBTriplet gain_pow_inv_gamma(
32 pow(gain.r, 1.0f / gamma.r),
33 pow(gain.g, 1.0f / gamma.g),
34 pow(gain.b, 1.0f / gamma.b));
35 set_uniform_vec3(glsl_program_num, prefix, "gain_pow_inv_gamma", (float *)&gain_pow_inv_gamma);
37 RGBTriplet inv_gamma_22(
41 set_uniform_vec3(glsl_program_num, prefix, "inv_gamma_22", (float *)&inv_gamma_22);