You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
348 B
19 lines
348 B
2 years ago
|
#version 330 core
|
||
|
|
||
|
uniform ivec2 viewsize;
|
||
|
|
||
|
layout(location = 0) in vec2 position;
|
||
|
layout(location = 2) in vec4 color;
|
||
|
|
||
|
out vec4 col;
|
||
|
|
||
|
|
||
|
void main()
|
||
|
{
|
||
|
vec2 v = vec2(float(viewsize.x), float(viewsize.y));
|
||
|
vec2 p = vec2(position.x*2.0/v.x - 1.0, 1.0 - position.y*2.0/v.y);
|
||
|
vec4 pos = vec4(p.x, p.y, 0.0f, 1.0f);
|
||
|
|
||
|
gl_Position = pos;
|
||
|
col = color;
|
||
|
}
|