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.
17 lines
264 B
GLSL
17 lines
264 B
GLSL
|
|
uniform mat4 projMat;
|
|
|
|
uniform mat4 spriteMat;
|
|
|
|
uniform vec2 texSizeInv;
|
|
|
|
attribute vec2 position;
|
|
attribute vec2 texCoord;
|
|
|
|
varying vec2 v_texCoord;
|
|
|
|
void main()
|
|
{
|
|
gl_Position = projMat * spriteMat * vec4(position, 0, 1);
|
|
v_texCoord = texCoord * texSizeInv;
|
|
}
|