2024-06-21 17:52:16 +02:00
|
|
|
#version 420 core
|
|
|
|
|
|
|
|
out vec2 TexPos;
|
|
|
|
|
|
|
|
layout (location = 0) in vec2 aPos;
|
|
|
|
layout (location = 1) in vec2 texPos;
|
|
|
|
|
|
|
|
uniform vec2 camPos;
|
2024-06-24 17:15:20 +02:00
|
|
|
uniform float zoom;
|
2024-06-21 17:52:16 +02:00
|
|
|
|
|
|
|
float invLerp( float a, float b, float v ){
|
|
|
|
return (v - a) / (b - a);
|
|
|
|
}
|
|
|
|
|
|
|
|
void main(){
|
2024-06-24 17:15:20 +02:00
|
|
|
gl_Position = vec4(zoom * (aPos + vec2(camPos.x, -camPos.y) * 2 / zoom), 0.0, 1.0);
|
2024-06-21 17:52:16 +02:00
|
|
|
TexPos = texPos;
|
|
|
|
}
|