From ddf1e4c77bde95a71a325998ebc3b984116d0c19 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Tue, 21 Sep 2010 13:32:31 +0100 Subject: [PATCH] effects: Make sure we're using GLSL 1.10 --- clutter/clutter-blur-effect.c | 22 +++++++++++----------- clutter/clutter-colorize-effect.c | 1 + clutter/clutter-desaturate-effect.c | 1 + 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/clutter/clutter-blur-effect.c b/clutter/clutter-blur-effect.c index 7ac2622d0..3b0ef43a4 100644 --- a/clutter/clutter-blur-effect.c +++ b/clutter/clutter-blur-effect.c @@ -55,6 +55,7 @@ typedef struct _ClutterBlurEffectClass ClutterBlurEffectClass; * horizontal/vertical two pass shader for the gaussian blur */ static const gchar *box_blur_glsl_shader = +"#version 110\n" "uniform sampler2D tex;\n" "uniform float x_step, y_step;\n" "\n" @@ -66,17 +67,16 @@ static const gchar *box_blur_glsl_shader = "void main ()\n" "{\n" " vec4 color = gl_Color * texture2D (tex, vec2 (gl_TexCoord[0].xy));\n" -" float count = 1.0;\n" -" color += get_rgba_rel (tex, -x_step, -y_step); count++;\n" -" color += get_rgba_rel (tex, 0.0, -y_step); count++;\n" -" color += get_rgba_rel (tex, x_step, -y_step); count++;\n" -" color += get_rgba_rel (tex, -x_step, 0.0); count++;\n" -" color += get_rgba_rel (tex, 0.0, 0.0); count++;\n" -" color += get_rgba_rel (tex, x_step, 0.0); count++;\n" -" color += get_rgba_rel (tex, -x_step, y_step); count++;\n" -" color += get_rgba_rel (tex, 0.0, y_step); count++;\n" -" color += get_rgba_rel (tex, x_step, y_step); count++;\n" -" gl_FragColor = color / count;\n" +" color += get_rgba_rel (tex, -x_step, -y_step);\n" +" color += get_rgba_rel (tex, 0.0, -y_step);\n" +" color += get_rgba_rel (tex, x_step, -y_step);\n" +" color += get_rgba_rel (tex, -x_step, 0.0);\n" +" color += get_rgba_rel (tex, 0.0, 0.0);\n" +" color += get_rgba_rel (tex, x_step, 0.0);\n" +" color += get_rgba_rel (tex, -x_step, y_step);\n" +" color += get_rgba_rel (tex, 0.0, y_step);\n" +" color += get_rgba_rel (tex, x_step, y_step);\n" +" gl_FragColor = color / 9.0;\n" "}"; struct _ClutterBlurEffect diff --git a/clutter/clutter-colorize-effect.c b/clutter/clutter-colorize-effect.c index b06058597..2da277d97 100644 --- a/clutter/clutter-colorize-effect.c +++ b/clutter/clutter-colorize-effect.c @@ -84,6 +84,7 @@ struct _ClutterColorizeEffectClass * Addison-Wesley */ static const gchar *colorize_glsl_shader = +"#version 110\n" "uniform sampler2D tex;\n" "uniform vec3 tint;\n" "\n" diff --git a/clutter/clutter-desaturate-effect.c b/clutter/clutter-desaturate-effect.c index 6018b1918..b501d6605 100644 --- a/clutter/clutter-desaturate-effect.c +++ b/clutter/clutter-desaturate-effect.c @@ -86,6 +86,7 @@ struct _ClutterDesaturateEffectClass * Addison-Wesley */ static const gchar *desaturate_glsl_shader = +"#version 110\n" "uniform sampler2D tex;\n" "uniform float factor;\n" "\n"