X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=blur_effect.cpp;h=17044f12f35c54681148814f38efebac4d37f5e0;hp=00c8fa093302ddfcef2367621a3cf085292d54f5;hb=86b456fd6112ba54dd890c4f8be408d297de07d5;hpb=f25eed80a570ae049f03b098757a070188efbc39 diff --git a/blur_effect.cpp b/blur_effect.cpp index 00c8fa0..17044f1 100644 --- a/blur_effect.cpp +++ b/blur_effect.cpp @@ -36,6 +36,16 @@ void BlurEffect::set_uniforms(GLuint glsl_program_num, const std::string &prefix pixel_size *= 2.0f; } + // In the second pass, we do the same, but don't sample from a mipmap; + // that would re-blur the other direction in an ugly fashion, and we already + // have the vertical box blur we need from that pass. + // + // TODO: We really need to present horizontal+vertical as a unit; + // currently, there's really no guarantee vertical blur is the second pass. + if (direction == VERTICAL) { + base_mipmap_level = 0; + } + glActiveTexture(GL_TEXTURE0); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, base_mipmap_level); check_error();