X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=blur_effect.cpp;h=d2178d873706244707a096e5e17b93317a7620f4;hp=adffe089a6d452d5f06a2c9907710aa152ee1f6f;hb=1c44926155efb721da02916f82af87d186a7fb57;hpb=1bd97eb70a6fcb913bf954e369bc1a90ba17f74e diff --git a/blur_effect.cpp b/blur_effect.cpp index adffe08..d2178d8 100644 --- a/blur_effect.cpp +++ b/blur_effect.cpp @@ -22,7 +22,7 @@ BlurEffect::BlurEffect() // The first blur pass will forward resolution information to us. hpass = new SingleBlurPassEffect(this); CHECK(hpass->set_int("direction", SingleBlurPassEffect::HORIZONTAL)); - vpass = new SingleBlurPassEffect(NULL); + vpass = new SingleBlurPassEffect(nullptr); CHECK(vpass->set_int("direction", SingleBlurPassEffect::VERTICAL)); update_radius(); @@ -111,7 +111,7 @@ SingleBlurPassEffect::SingleBlurPassEffect(BlurEffect *parent) direction(HORIZONTAL), width(1280), height(720), - uniform_samples(NULL) + uniform_samples(nullptr) { register_float("radius", &radius); register_int("direction", (int *)&direction); @@ -208,9 +208,8 @@ void SingleBlurPassEffect::set_gl_state(GLuint glsl_program_num, const string &p float w2 = weight[base_pos + 1]; float pos1 = base_pos / (float)size; - float pos2 = (base_pos + 1) / (float)size; float pos, total_weight; - combine_two_samples(w1, w2, pos1, pos2, num_subtexels, inv_num_subtexels, &pos, &total_weight, NULL); + combine_two_samples(w1, w2, pos1, 1.0 / (float)size, size, num_subtexels, inv_num_subtexels, &pos, &total_weight, nullptr); uniform_samples[2 * i + 0] = pos; uniform_samples[2 * i + 1] = total_weight;