2007-12-14 16:57:38 +00:00
|
|
|
varying vec2 samplePos1;
|
|
|
|
varying vec2 samplePos2;
|
|
|
|
varying vec2 samplePos3;
|
|
|
|
varying vec2 samplePos4;
|
|
|
|
varying vec2 samplePos5;
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2007-12-14 16:57:38 +00:00
|
|
|
uniform float textureWidth;
|
|
|
|
uniform float textureHeight;
|
2007-04-29 17:35:43 +00:00
|
|
|
attribute float xBlur;
|
|
|
|
attribute float yBlur;
|
|
|
|
|
|
|
|
|
2007-12-14 16:57:38 +00:00
|
|
|
vec2 mkSamplePos(vec2 origin, float offset)
|
|
|
|
{
|
|
|
|
vec2 foo = origin + vec2(xBlur, yBlur) * offset;
|
|
|
|
return vec2(foo.x / textureWidth, 1.0 - foo.y / textureHeight);
|
|
|
|
}
|
|
|
|
|
2007-04-29 17:35:43 +00:00
|
|
|
void main()
|
|
|
|
{
|
2007-12-14 16:57:38 +00:00
|
|
|
samplePos1 = mkSamplePos(gl_Vertex.xy, 0.0);
|
|
|
|
samplePos2 = mkSamplePos(gl_Vertex.xy, -1.5);
|
|
|
|
samplePos3 = mkSamplePos(gl_Vertex.xy, 1.5);
|
|
|
|
samplePos4 = mkSamplePos(gl_Vertex.xy, 3.5);
|
|
|
|
samplePos5 = mkSamplePos(gl_Vertex.xy, -3.5);
|
|
|
|
|
2007-04-29 17:35:43 +00:00
|
|
|
gl_Position = ftransform();
|
|
|
|
}
|