tweak renderer API

This commit is contained in:
Alessandro Mauri 2025-06-10 23:02:44 +02:00
parent 177e52b0d0
commit 2014c67bfd
10 changed files with 424 additions and 247 deletions

View file

@ -2,7 +2,6 @@
layout(set = 1, binding = 0) uniform Viewport {
ivec2 view;
ivec2 off;
};
layout(location = 0) in ivec2 position;
@ -16,17 +15,12 @@ layout(location = 3) out float radius;
void main()
{
// per vertex shift
vec2 shift;
shift.x = float(off.x) / view.x;
shift.y = -(float(off.y) / view.y);
// vertex position
vec2 pos;
pos.x = float(position.x)*2.0 / view.x - 1.0;
pos.y = -(float(position.y)*2.0 / view.y - 1.0);
gl_Position = vec4(pos+shift, 0.0, 1.0);
gl_Position = vec4(pos, 0.0, 1.0);
local_position = vec2(sign(uv));
global_position = gl_Position.xy;