diff options
| author | Jonathan Bradley <jcb@pikum.xyz> | 2025-02-28 22:33:58 -0500 |
|---|---|---|
| committer | Jonathan Bradley <jcb@pikum.xyz> | 2025-02-28 22:33:58 -0500 |
| commit | 37347bf7811a5fa42c98e2a19adfee15252ee479 (patch) | |
| tree | 70fe178ad777f52404f51b90c06b8d14ef101276 /assets/shaders/ui-base.frag | |
| parent | 85bbecbdebf4f096418aea1cd4f9616f9d97e451 (diff) | |
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).
Diffstat (limited to 'assets/shaders/ui-base.frag')
| -rw-r--r-- | assets/shaders/ui-base.frag | 23 |
1 files changed, 23 insertions, 0 deletions
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; + } +} |
