kwin/scene-vertex.glsl
Martin Gräßlin a728823fbe Fix passing matrixes to the shaders
QMatrix4x4 accepts data in row-major order, but returns them in
column-major order, which is not documented and because of that
I expected them to be in row-major order.
This commit fixes it and rewrites the shaders to apply the matrix
multiplications in the right order.
REVIEW: 100759
2011-03-06 09:13:31 +01:00

19 lines
508 B
GLSL

uniform mat4 projection;
// offset of the window/texture to be rendered
uniform vec2 offset;
uniform float textureWidth;
uniform float textureHeight;
// passed in vertex - only x and y are used
attribute vec4 vertex;
// passed in texCoords - to be forwarded
attribute vec2 texCoord;
// texCoords passed to fragment shader
varying vec2 varyingTexCoords;
void main() {
varyingTexCoords = texCoord / vec2(textureWidth, textureHeight);
gl_Position = projection*vec4(vertex.xy + offset, vertex.zw);
}