a05ad98896
The uniforms textureWidth and textureHeight were only needed for normal windows. For everything else it was just 1.0/1.0, that is normalized. The makeArrays method is changed to produce normalized texcoords obsoleting the need for these uniforms. So two uniforms less, one calculation in vertex shaders less and many many lines of code removed. At the same time makeArrays is also adjusted to take care of yInverted of the texture, which is needed as we no longer can use the enableUnnormalizedTexCoords which did the yInverted transformation. REVIEW: 101646
16 lines
414 B
GLSL
16 lines
414 B
GLSL
uniform mat4 projection;
|
|
// offset of the window/texture to be rendered
|
|
uniform vec2 offset;
|
|
|
|
// 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;
|
|
gl_Position = projection*vec4(vertex.xy + offset, vertex.zw);
|
|
}
|