rounded quads baby!

This commit is contained in:
Alessandro Mauri 2025-06-10 12:54:03 +02:00
parent 3a0904023a
commit 177e52b0d0
4 changed files with 66 additions and 9 deletions

View file

@ -10,6 +10,9 @@ layout(location = 1) in ivec2 uv;
layout(location = 2) in ivec4 color;
layout(location = 0) out vec4 col;
layout(location = 1) out vec2 local_position;
layout(location = 2) out vec2 global_position;
layout(location = 3) out float radius;
void main()
{
@ -24,5 +27,10 @@ void main()
pos.y = -(float(position.y)*2.0 / view.y - 1.0);
gl_Position = vec4(pos+shift, 0.0, 1.0);
local_position = vec2(sign(uv));
global_position = gl_Position.xy;
radius = abs(float(uv.x));
col = vec4(color) / 255.0;
}