2024-03-25 06:12:51 +00:00
|
|
|
#version 450
|
|
|
|
|
|
|
|
layout (set = 0, binding = 0) uniform Descriptor {
|
2024-03-25 07:30:00 +00:00
|
|
|
vec4 background_color;
|
|
|
|
vec4 border_color;
|
|
|
|
|
|
|
|
uint width;
|
|
|
|
uint height;
|
|
|
|
uint border_thickness;
|
2024-03-25 06:12:51 +00:00
|
|
|
} descriptor;
|
|
|
|
|
|
|
|
layout (location = 0) out vec4 out_color;
|
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
2024-03-25 09:12:52 +00:00
|
|
|
vec2 st = gl_FragCoord.xy/vec2((float)descriptor.width, (float)descriptor.height);
|
|
|
|
|
|
|
|
if ((uint)st.x <= descriptor.border_thickness ||
|
|
|
|
(uint)st.x >= (descriptor.width - descriptor.border_thickness))
|
|
|
|
{
|
|
|
|
out_color = descriptor.border_color;
|
|
|
|
}
|
|
|
|
else if (
|
|
|
|
(uint)st.y <= descriptor.border_thickness ||
|
|
|
|
(uint)st.y >= (descriptor.height - descriptor.border_thickness)
|
|
|
|
) {
|
|
|
|
out_color = descriptor.border_color;
|
|
|
|
} else {
|
|
|
|
out_color = descriptor.background_color;
|
|
|
|
}
|
2024-03-25 06:12:51 +00:00
|
|
|
}
|