Fixing for OS X

This commit is contained in:
Siana Gearz
2011-10-31 16:00:05 +01:00
parent f386fc75df
commit 231af66b90

View File

@@ -4,28 +4,28 @@
uniform sampler2DRect RenderTexture; uniform sampler2DRect RenderTexture;
uniform int horizontalPass; uniform int horizontalPass;
uniform float offset[2] = float[2]( 1.3846153846, 3.2307692308 ); vec2 offset = vec2( 1.3846153846, 3.2307692308 );
uniform float weight[3] = float[3]( 0.2270270270, 0.3162162162, 0.0702702703 ); vec3 weight = vec3( 0.2270270270, 0.3162162162, 0.0702702703 );
void main(void) void main(void)
{ {
vec4 color = texture2DRect(RenderTexture, gl_TexCoord[0].st)*weight[0]; vec4 color = texture2DRect(RenderTexture, gl_TexCoord[0].st)*weight.x;
if(horizontalPass == 1) if(horizontalPass == 1)
{ {
color += weight[1] * texture2DRect(RenderTexture, vec2(gl_TexCoord[0].x+offset[0],gl_TexCoord[0].y)); color += weight.y * texture2DRect(RenderTexture, vec2(gl_TexCoord[0].x+offset.x,gl_TexCoord[0].y));
color += weight[1] * texture2DRect(RenderTexture, vec2(gl_TexCoord[0].x-offset[0],gl_TexCoord[0].y)); color += weight.y * texture2DRect(RenderTexture, vec2(gl_TexCoord[0].x-offset.x,gl_TexCoord[0].y));
color += weight[2] * texture2DRect(RenderTexture, vec2(gl_TexCoord[0].x+offset[1],gl_TexCoord[0].y)); color += weight.z * texture2DRect(RenderTexture, vec2(gl_TexCoord[0].x+offset.y,gl_TexCoord[0].y));
color += weight[2] * texture2DRect(RenderTexture, vec2(gl_TexCoord[0].x-offset[1],gl_TexCoord[0].y)); color += weight.z * texture2DRect(RenderTexture, vec2(gl_TexCoord[0].x-offset.y,gl_TexCoord[0].y));
} }
else else
{ {
color += weight[1] * texture2DRect(RenderTexture, vec2(gl_TexCoord[0].x,gl_TexCoord[0].y+offset[0])); color += weight.y * texture2DRect(RenderTexture, vec2(gl_TexCoord[0].x,gl_TexCoord[0].y+offset.x));
color += weight[1] * texture2DRect(RenderTexture, vec2(gl_TexCoord[0].x,gl_TexCoord[0].y-offset[0])); color += weight.y * texture2DRect(RenderTexture, vec2(gl_TexCoord[0].x,gl_TexCoord[0].y-offset.x));
color += weight[2] * texture2DRect(RenderTexture, vec2(gl_TexCoord[0].x,gl_TexCoord[0].y+offset[1])); color += weight.z * texture2DRect(RenderTexture, vec2(gl_TexCoord[0].x,gl_TexCoord[0].y+offset.y));
color += weight[2] * texture2DRect(RenderTexture, vec2(gl_TexCoord[0].x,gl_TexCoord[0].y-offset[1])); color += weight.z * texture2DRect(RenderTexture, vec2(gl_TexCoord[0].x,gl_TexCoord[0].y-offset.y));
} }
gl_FragColor = color; gl_FragColor = color;
} }