render boxes

This commit is contained in:
Alessandro Mauri 2023-02-25 22:50:31 +01:00
parent 9de467eae9
commit a7a2193ea6
No known key found for this signature in database
GPG key ID: 2B7BF9531FF03BE8
5 changed files with 174 additions and 18 deletions

View file

@ -0,0 +1,19 @@
#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;
}