4
uniform mat4 ViewProjectionMatrix;
6
attribute vec4 AVertex;
7
attribute vec4 TextureCoord0;
8
attribute vec4 VertexColor;
10
varying vec4 varyTexCoord0;
11
varying vec4 varyVertexColor;
15
varyTexCoord0 = TextureCoord0;
16
varyVertexColor = VertexColor;
17
gl_Position = ViewProjectionMatrix * (AVertex);
22
#extension GL_ARB_texture_rectangle : enable
24
varying vec4 varyTexCoord0;
25
varying vec4 varyVertexColor;
28
uniform sampler2D TextureObject0;
29
uniform vec2 TextureSize0;
30
vec4 SampleTexture(sampler2D TexObject, vec2 TexCoord)
32
return texture2D(TexObject, TexCoord.st);
34
#elif defined SAMPLERTEX2DRECT
35
uniform sampler2DRect TextureObject0;
36
uniform vec2 TextureSize0;
37
vec4 SampleTexture(sampler2DRect TexObject, vec2 TexCoord)
39
return texture2DRect(TexObject, TexCoord.st);
43
#define NUM_SAMPLES 55
44
uniform float W[NUM_SAMPLES];
46
#ifdef HORIZONTALGAUSS
49
vec4 sum = vec4(0.0, 0.0, 0.0, 0.0);
50
vec2 delta = vec2(1.0 / TextureSize0.x, 0.0);
52
vec2 texCoord = vec2(varyTexCoord0.s, varyTexCoord0.t);
53
texCoord.x -= ((NUM_SAMPLES -1)/2) / TextureSize0.x;
54
texCoord.y += 0.0 / TextureSize0.y;
56
for(int i = 0; i < NUM_SAMPLES; ++i)
58
sum += SampleTexture(TextureObject0, texCoord) * W[i];
61
gl_FragColor = vec4(sum.x, sum.y, sum.z, sum.w);
68
vec4 sum = vec4(0.0, 0.0, 0.0, 0.0);
69
vec2 delta = vec2(0.0, 1.0 / TextureSize0.y);
71
vec2 texCoord = vec2(varyTexCoord0.s, varyTexCoord0.t);
72
texCoord.x += 0.0 / TextureSize0.x;
73
texCoord.y -= ((NUM_SAMPLES -1)/2) / TextureSize0.y;
75
for(int i = 0; i < NUM_SAMPLES; ++i)
77
sum += SampleTexture(TextureObject0, texCoord) * W[i];
80
gl_FragColor = vec4(sum.x, sum.y, sum.z, sum.w);