The drawing is now completely shader based, which makes away with all usage of the depracted matrix stack. This also allows us to do things like simple translations and texture coordinate translation directly instead of doing everything indirectly through matrices. Fixed vertex attributes ('vertexPointer()' etc) are also replaced with user defined attribute arrays.
20 lines
330 B
GLSL
20 lines
330 B
GLSL
|
|
uniform mat4 projMat;
|
|
|
|
uniform vec2 texSizeInv;
|
|
uniform vec2 translation;
|
|
|
|
attribute vec2 position;
|
|
attribute vec2 texCoord;
|
|
attribute vec4 color;
|
|
|
|
varying vec2 v_texCoord;
|
|
varying vec4 v_color;
|
|
|
|
void main()
|
|
{
|
|
gl_Position = projMat * vec4(position + translation, 0, 1);
|
|
|
|
v_texCoord = texCoord * texSizeInv;
|
|
v_color = color;
|
|
}
|