[clutter] blur-effect: Fix the blur filter



commit fd375a7bc962517439303203cf7443caaf729e93
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Thu Aug 30 21:02:38 2012 -0300

    blur-effect: Fix the blur filter
    
    Make sure we don't sample the center twice, and don't sample things
    that aren't our immediate neighbors.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=683076

 clutter/clutter-blur-effect.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)
---
diff --git a/clutter/clutter-blur-effect.c b/clutter/clutter-blur-effect.c
index 1e36a0c..305e1f2 100644
--- a/clutter/clutter-blur-effect.c
+++ b/clutter/clutter-blur-effect.c
@@ -58,18 +58,15 @@
  */
 static const gchar *box_blur_glsl_declarations =
 "uniform vec2 pixel_step;\n";
-/* FIXME: Is this shader right? It is doing 10 samples (ie, sampling
-   the middle texel twice) and then only dividing by 9 */
 #define SAMPLE(offx, offy) \
   "cogl_texel += texture2D (cogl_sampler, cogl_tex_coord.st + pixel_step * " \
-  "vec2 (" G_STRINGIFY (offx) ", " G_STRINGIFY (offy) ") * 2.0);\n"
+  "vec2 (" G_STRINGIFY (offx) ", " G_STRINGIFY (offy) "));\n"
 static const gchar *box_blur_glsl_shader =
 "  cogl_texel = texture2D (cogl_sampler, cogl_tex_coord.st);\n"
   SAMPLE (-1.0, -1.0)
   SAMPLE ( 0.0, -1.0)
   SAMPLE (+1.0, -1.0)
   SAMPLE (-1.0,  0.0)
-  SAMPLE ( 0.0,  0.0)
   SAMPLE (+1.0,  0.0)
   SAMPLE (-1.0, +1.0)
   SAMPLE ( 0.0, +1.0)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]