mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-18 14:08:19 +00:00
32 lines
667 B
GLSL
32 lines
667 B
GLSL
#version 330
|
|
|
|
layout (location = 0) in vec4 inVertex;
|
|
layout (location = 1) in vec4 inColor;
|
|
|
|
uniform mat4x2 Pos;
|
|
|
|
uniform vec2 Offset;
|
|
uniform float Rotation;
|
|
|
|
noperspective out vec4 quadColor;
|
|
|
|
void main()
|
|
{
|
|
vec2 FinalPos = vec2(inVertex.xy);
|
|
|
|
if(Rotation != 0.0)
|
|
{
|
|
float X = FinalPos.x - inVertex.z;
|
|
float Y = FinalPos.y - inVertex.w;
|
|
|
|
FinalPos.x = X * cos(Rotation) - Y * sin(Rotation) + inVertex.z;
|
|
FinalPos.y = X * sin(Rotation) + Y * cos(Rotation) + inVertex.w;
|
|
}
|
|
|
|
FinalPos.x = FinalPos.x / 1024.0 + Offset.x;
|
|
FinalPos.y = FinalPos.y / 1024.0 + Offset.y;
|
|
|
|
gl_Position = vec4(Pos * vec4(FinalPos, 0.0, 1.0), 0.0, 1.0);
|
|
quadColor = inColor;
|
|
}
|