2010-12-12 12:40:39 +00:00
|
|
|
uniform mat4 projection;
|
|
|
|
// offset of the window/texture to be rendered
|
|
|
|
uniform vec2 offset;
|
2010-11-14 19:49:00 +00:00
|
|
|
|
2011-02-10 19:15:23 +00:00
|
|
|
uniform float textureWidth;
|
|
|
|
uniform float textureHeight;
|
|
|
|
|
2010-11-14 19:49:00 +00:00
|
|
|
// passed in vertex - only x and y are used
|
2010-11-28 15:21:12 +00:00
|
|
|
attribute vec4 vertex;
|
2010-11-14 19:49:00 +00:00
|
|
|
// passed in texCoords - to be forwarded
|
2010-11-28 15:21:12 +00:00
|
|
|
attribute vec2 texCoord;
|
2010-11-14 19:49:00 +00:00
|
|
|
|
|
|
|
// texCoords passed to fragment shader
|
2010-11-28 15:21:12 +00:00
|
|
|
varying vec2 varyingTexCoords;
|
2010-11-14 19:49:00 +00:00
|
|
|
|
|
|
|
void main() {
|
2011-02-10 19:15:23 +00:00
|
|
|
varyingTexCoords = texCoord / vec2(textureWidth, textureHeight);
|
2011-03-06 08:10:21 +00:00
|
|
|
gl_Position = projection*vec4(vertex.xy + offset, vertex.zw);
|
2010-11-14 19:49:00 +00:00
|
|
|
}
|