From 37347bf7811a5fa42c98e2a19adfee15252ee479 Mon Sep 17 00:00:00 2001 From: Jonathan Bradley Date: Fri, 28 Feb 2025 22:33:58 -0500 Subject: pke: checkpoint: vk renames + first-pass ui Renamed pipeline and descriptor names to be more self-descriptive. UI work is not done, and will not record. Needs vulkan items created (buffers). --- assets/shaders/ui-base.frag | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 assets/shaders/ui-base.frag (limited to 'assets/shaders/ui-base.frag') diff --git a/assets/shaders/ui-base.frag b/assets/shaders/ui-base.frag new file mode 100644 index 0000000..d6a9882 --- /dev/null +++ b/assets/shaders/ui-base.frag @@ -0,0 +1,23 @@ +# version 450 + +layout(location = 0) in vec4 in_border_color; +layout(location = 1) in vec4 in_background_color; +layout(location = 2) in vec2 in_px_scale; +layout(location = 3) in vec2 in_uv; + +layout(location = 0) out vec4 out_color; + +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.x + || in_uv.y >= 1.0-in_px_scale.x; +} + +void main() { + if (is_in_border()) { + out_color = in_border_color; + } else { + out_color = in_background_color; + } +} -- cgit v1.2.3