kwin/scene-generic-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

20 lines
559 B
GLSL

uniform mat4 projection;
uniform mat4 modelview;
uniform mat4 screenTransformation;
uniform mat4 windowTransformation;
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*(modelview*screenTransformation*windowTransformation)*vertex;
}