prosperon/source/shaders/gridvert.glsl

18 lines
292 B
Plaintext
Raw Normal View History

2022-06-21 23:16:14 -05:00
#version 330
layout (location = 0) in vec2 pos;
out vec2 apos;
2023-02-13 08:30:35 -06:00
uniform vec2 offset;
2022-06-21 23:16:14 -05:00
layout (std140) uniform Projection {
mat4 projection;
};
void main()
{
2023-02-13 08:30:35 -06:00
vec4 ipos = inverse(projection) * vec4(pos, 0.f, 1.f);
apos = ipos.xy + offset;
2022-06-21 23:16:14 -05:00
gl_Position = vec4(pos, 0.f, 1.f);
2023-02-13 08:30:35 -06:00
}