From 88df999a8ff35ea30b8fa9cf94c46dd748215581 Mon Sep 17 00:00:00 2001 From: nextdaydelivery <12willettsh@gmail.com> Date: Sat, 12 Feb 2022 09:24:51 +0000 Subject: swoosh --- .../assets/oneconfig/shaders/rounded_rect.fsh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/main/resources/assets/oneconfig/shaders/rounded_rect.fsh (limited to 'src/main/resources/assets/oneconfig/shaders') diff --git a/src/main/resources/assets/oneconfig/shaders/rounded_rect.fsh b/src/main/resources/assets/oneconfig/shaders/rounded_rect.fsh new file mode 100644 index 0000000..f0bec7c --- /dev/null +++ b/src/main/resources/assets/oneconfig/shaders/rounded_rect.fsh @@ -0,0 +1,18 @@ +#version 110 + +uniform float u_Radius; +uniform vec4 u_InnerRect; + +varying vec2 f_Position; + +//out vec4 fragColor; + +void main() { + vec2 tl = u_InnerRect.xy - f_Position; + vec2 br = f_Position - u_InnerRect.zw; + vec2 dis = max(br, tl); + + float v = length(max(vec2(0.0), dis)) - u_Radius; + float a = 1.0 - smoothstep(0.0, 1.0, v); + gl_FragColor = gl_Color * vec4(1.0, 1.0, 1.0, a); +} \ No newline at end of file -- cgit