effects: Make sure we're using GLSL 1.10

This commit is contained in:
Emmanuele Bassi 2010-09-21 13:32:31 +01:00
parent 9f2b62a595
commit ddf1e4c77b
3 changed files with 13 additions and 11 deletions

View File

@ -55,6 +55,7 @@ typedef struct _ClutterBlurEffectClass ClutterBlurEffectClass;
* horizontal/vertical two pass shader for the gaussian blur * horizontal/vertical two pass shader for the gaussian blur
*/ */
static const gchar *box_blur_glsl_shader = static const gchar *box_blur_glsl_shader =
"#version 110\n"
"uniform sampler2D tex;\n" "uniform sampler2D tex;\n"
"uniform float x_step, y_step;\n" "uniform float x_step, y_step;\n"
"\n" "\n"
@ -66,17 +67,16 @@ static const gchar *box_blur_glsl_shader =
"void main ()\n" "void main ()\n"
"{\n" "{\n"
" vec4 color = gl_Color * texture2D (tex, vec2 (gl_TexCoord[0].xy));\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);\n"
" color += get_rgba_rel (tex, -x_step, -y_step); count++;\n" " color += get_rgba_rel (tex, 0.0, -y_step);\n"
" color += get_rgba_rel (tex, 0.0, -y_step); count++;\n" " color += get_rgba_rel (tex, x_step, -y_step);\n"
" color += get_rgba_rel (tex, x_step, -y_step); count++;\n" " color += get_rgba_rel (tex, -x_step, 0.0);\n"
" color += get_rgba_rel (tex, -x_step, 0.0); count++;\n" " color += get_rgba_rel (tex, 0.0, 0.0);\n"
" color += get_rgba_rel (tex, 0.0, 0.0); count++;\n" " color += get_rgba_rel (tex, x_step, 0.0);\n"
" color += get_rgba_rel (tex, x_step, 0.0); count++;\n" " color += get_rgba_rel (tex, -x_step, y_step);\n"
" color += get_rgba_rel (tex, -x_step, y_step); count++;\n" " color += get_rgba_rel (tex, 0.0, y_step);\n"
" color += get_rgba_rel (tex, 0.0, y_step); count++;\n" " color += get_rgba_rel (tex, x_step, y_step);\n"
" color += get_rgba_rel (tex, x_step, y_step); count++;\n" " gl_FragColor = color / 9.0;\n"
" gl_FragColor = color / count;\n"
"}"; "}";
struct _ClutterBlurEffect struct _ClutterBlurEffect

View File

@ -84,6 +84,7 @@ struct _ClutterColorizeEffectClass
* Addison-Wesley * Addison-Wesley
*/ */
static const gchar *colorize_glsl_shader = static const gchar *colorize_glsl_shader =
"#version 110\n"
"uniform sampler2D tex;\n" "uniform sampler2D tex;\n"
"uniform vec3 tint;\n" "uniform vec3 tint;\n"
"\n" "\n"

View File

@ -86,6 +86,7 @@ struct _ClutterDesaturateEffectClass
* Addison-Wesley * Addison-Wesley
*/ */
static const gchar *desaturate_glsl_shader = static const gchar *desaturate_glsl_shader =
"#version 110\n"
"uniform sampler2D tex;\n" "uniform sampler2D tex;\n"
"uniform float factor;\n" "uniform float factor;\n"
"\n" "\n"