From d154b48f99aa7cf50cb6e50b4a7668b0e8489cb5 Mon Sep 17 00:00:00 2001 From: Jonathan Bradley Date: Tue, 18 Nov 2025 10:26:52 -0500 Subject: pke: static-ui pixel size in UV != screen --- assets/shaders/ui-base.frag | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'assets') diff --git a/assets/shaders/ui-base.frag b/assets/shaders/ui-base.frag index 815e1c8..6fa0758 100644 --- a/assets/shaders/ui-base.frag +++ b/assets/shaders/ui-base.frag @@ -7,17 +7,18 @@ layout(location = 3) in vec3 in_uv; layout(location = 0) out vec4 out_color; +const float border_px = 1.f; + bool is_in_border() { - return in_uv.x <= in_px_scale.x - || in_uv.x >= 1.0-in_px_scale.x - || in_uv.y <= in_px_scale.y - || in_uv.y >= 1.0-in_px_scale.y; + return (in_uv.x <= ((in_px_scale.x*border_px))) + || (in_uv.x >= 1.0-((in_px_scale.x*border_px))) + || (in_uv.y <= (in_px_scale.y*border_px)) + || (in_uv.y >= 1.0- (in_px_scale.y*border_px)); } void main() { + out_color = in_background_color; if (is_in_border()) { out_color = in_border_color; - } else { - out_color = in_background_color; } } -- cgit v1.2.3