kwin/scene-vertex.glsl
Martin Gräßlin 56ce39def8 Core profile compatible basic scene rendering.
Adds a shader to render an untransformed scene. renderGLGeometry is not used any more and replaced by generated triangles stored in a GLVertexBuffer.
The GLVertexBuffer has a new attribute to decide whether a core profile compatible rendering has to be performed.
Currently windows and EffectFrames can make use of the new shader.
The shader contains a debug mode which colours all rendered fragments in green. It is currently enabled in scene_opengl.
Rendering transformed geometries (without shader) is currently broken.
2011-01-30 14:11:55 +01:00

17 lines
562 B
GLSL

// size of the complete display in pixels, x==width, y==height
uniform vec2 displaySize;
// geometry of the window/texture to be rendered: x, y, width, height in display geometry
uniform vec4 geometry;
// passed in vertex - only x and y are used
in vec4 vertex;
// passed in texCoords - to be forwarded
in vec2 texCoord;
// texCoords passed to fragment shader
varying out vec2 varyingTexCoords;
void main() {
varyingTexCoords = texCoord;
gl_Position.xy = 2*vec2(geometry.x + vertex.x, displaySize.y - vertex.y - geometry.y)/displaySize - vertex.ww;
}